profiling,-O in 6.12.1

Serge D. Mechveliani mechvel at
Wed Feb 3 10:44:31 EST 2010

Dear GHC team,

It looks like  ghc-6.12.1  reports erroneous time profiling --
when the Main module of the project is made under  -O.

This is for  ghc-6.12.1  made from source for Debian Linux and 

Main.main  calls for  Complete.complete,  `complete' calls for  
eLoop  inside its source.
eLoop  must take almost all the time.
My whole user library is made under  -O -prof,  and 
Main  is compiled by
                         ghc $dmCpOpt -prof --make Main
and run by               ./Main +RTS -M400m -pT -RTS
For this key, the profiling report looks natural and shows  
                                                   eLoop -- 97%.

But for        ghc $dmCpOpt  -O  -prof --make Make,

it shows a different thing:  zero  for  eLoop  and  99%  for `main'.

How could this additional  -O  mislead the compiler?
Also, as I recall,  -O  is still by default -- ?

Could you explain, please?


Serge Mechveliani
mechvel at

More information about the Glasgow-haskell-users mailing list