#1179: 20x slow down with -O or -O2
-------------------------+--------------------------------------------------
    Reporter:  dons      |       Owner:       
        Type:  bug       |      Status:  new  
    Priority:  normal    |   Milestone:       
   Component:  Compiler  |     Version:  6.6  
    Severity:  normal    |    Keywords:  slow 
  Difficulty:  Unknown   |    Testcase:       
Architecture:  Multiple  |          Os:  Linux
-------------------------+--------------------------------------------------
This program:

 {{{
 http://www.cse.unsw.edu.au/~dons/code/nobench/spectral/calendar/
 }}}

 Suffers a misoptimisation when compiled with -O or -O2.
 When compiled with -Onot:

 {{{
 serenity$ ghc -Onot --make -o calendar calendar.hs -no-recomp
 [1 of 1] Compiling Main             ( calendar.hs, calendar.o )
 Linking calendar ...

 serenity$ time ./calendar 1993 10000 > /dev/null
 ./calendar 1993 10000 > /dev/null  0.02s user 0.00s system 99% cpu 0.021
 total
 }}}

 When compiled with -O:

 {{{
 serenity$ ghc -O --make -o calendar calendar.hs -no-recomp
 [1 of 1] Compiling Main             ( calendar.hs, calendar.o )
 Linking calendar ...

 serenity$ time ./calendar 1993 10000 > /dev/null
 ./calendar 1993 10000 > /dev/null  5.00s user 0.01s system 99% cpu 5.011
 total
 }}}

 And with -O2:

 {{{
 serenity$ time ./calendar 1993 10000 > /dev/null
 ./calendar 1993 10000 > /dev/null  4.95s user 0.01s system 100% cpu 4.953
 total
 }}}

 Reproduced in amd64 and x86 linux.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1179>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to