
#14677: Code generator does not correctly tag a pointer -------------------------------------+------------------------------------- Reporter: simonpj | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: 14626 Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by alexbiehl): I think a patch might be more involved: This is the core for `evtWrite` {{{ -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} evtWrite1_r335 :: Int [GblId, Caf=NoCafRefs, Str=m] evtWrite1_r335 = GHC.Types.I# 2# -- RHS size: {terms: 1, types: 0, coercions: 2, joins: 0/0} evtWrite [InlPrag=INLINE (sat-args=0)] :: Event [GblId, Str=m, Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=ALWAYS_IF(arity=0,unsat_ok=False,boring_ok=False) Tmpl= (GHC.Types.I# 2#) `cast` (Sym T14677_1.N:Event[0] :: (Int :: *) ~R# (Event :: *))}] evtWrite = evtWrite1_r335 `cast` (Sym T14677_1.N:Event[0] :: (Int :: *) ~R# (Event :: *)) }}} So it's already an indirection in Core! Maybe we shouldn't lift the integer out of `evtWrite` and make an expression of the form {{{ e `cast` co }}} where `e` is a satured constructor application. CoreToStg could spot this case and make it a proper `StgConApp` which will then be codegened into a proper constant. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14677#comment:18 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler