duncan.coutts at worc.ox.ac.uk
Thu Jun 15 06:16:44 EDT 2006
On Thu, 2006-06-15 at 12:48 +0400, Bulat Ziganshin wrote:
> Hello Donald,
> your Cabal file for FPS includes "-O -optc-O2" ghc options. i suggest
> to use "-O2" instead because:
> 1) it makes one of my tests 1.5 times faster; i think that other
> functions can also get improvement
> 2) with ghc 6.4.1, "-optc-O2" can cause an compiler bug
> 3) on ghc 6.4.2, this bug is fixed and "-O2" automatically enables "-optc-O2"
In 6.5 I think you mean. From my reading of the code in 6.4.2 it always
uses -O, not -O2.
Actually, enabling -O2 for gcc will cause problems on some arches,
notably ia64 and very occasionally sparc iirc. These are mainly issues
related to the mangler I believe.
Simon, I can send a patch, but what's the best way to do per-arch bits
in main/DriverPipeline.hs? Is there a runtime var for the arch or should
I use #ifdefs, or should it go in configure somewhere to centralise
At the moment the code (in DriverPipeline.runPhase) is just:
let cc_opt | optLevel dflags >= 2 = "-O2"
| otherwise = "-O"
More information about the Cvs-ghc