Open ipuustin opened 10 years ago
I think you need to add the following to the module which defines mode1
and mode2
:
{-# OPTIONS_GHC -fno-cse #-}
That should fix it. Alternatively, you can omit the common
definition in mode2
and it will automatically follow the definition in mode1
. Unfortunately CmdArgs is a bit impure when constructing the record, and the CSE that GHC does breaks things. You can read a more complete explanation (in the docs)[http://hackage.haskell.org/package/cmdargs/docs/System-Console-CmdArgs-Implicit.html]. Does that fix it for you?
Yes, this fixed it. I missed (or didn't parse) the shared annotation part in the docs. Thanks! Closing the issue.
I've just checked. I have some stuff that makes CSE less likely to happen, which works fine in GHC 7.6, but has broken in 7.8. I'll see if I can fix it.
"me too"
The second mode of http://hackage.haskell.org/package/haeredes is affected by this, but it can be built with -fno-cse as a workaround.
Hi,
When I compile a modal application with optimizations on (such as is done by default with cabal), the command line parsing doesn't work as expected. Here's a small example program:
This is what should happen, compiled with
ghc --make Main.hs
:This is the error case when the second mode doesn't work, compiled with
ghc --make -O Main.hs
:I'm using GHC 7.8.3: