[GHC] #11292: Generics unboxed types: TEST=GEq1 WAY=optasm is failing
GHC
ghc-devs at haskell.org
Tue Dec 29 02:38:31 UTC 2015
#11292: Generics unboxed types: TEST=GEq1 WAY=optasm is failing
-------------------------------------+-------------------------------------
Reporter: thomie | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.11
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by rwbarton):
It looks like GHC is happy to inline everything in your simplified example
leaving
{{{
Main.main2 =
case GHC.Prim.tagToEnum#
@ GHC.Types.Bool (GHC.Prim.eqAddr# "a"# "a"#)
of _ [Occ=Dead] {
GHC.Types.False -> GHC.Show.shows26;
GHC.Types.True -> GHC.Show.shows24
}
}}}
The value `"a"#` has been duplicated, so there are now two copies of the
string constant in the program, with different addresses.
For your test you can presumably work around this with NOINLINE
annotations on `u0` and `uf0`.
This duplication seems like generally undesirable behavior though; leaving
aside the question of whether or not it is "semantically correct", it
makes the resulting object file unnecessarily large (imagine the string
was much longer than a single character). Probably worth opening a
separate ticket.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11292#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list