Opened 8 years ago

Closed 8 years ago

Last modified 7 years ago

#1179 closed bug (duplicate)

20x slow down with -O or -O2

Reported by: dons Owned by:
Priority: normal Milestone:
Component: Compiler Version: 6.6
Keywords: slow Cc:
Operating System: Linux Architecture: Unknown/Multiple
Type of failure: Test Case:
Blocked By: Blocking:
Related Tickets: Differential Revisions:

Description

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.

Change History (3)

comment:1 Changed 8 years ago by kirsten

Looks like a dup of Ticket #1168 to me.

comment:2 Changed 8 years ago by simonmar

  • Resolution set to duplicate
  • Status changed from new to closed

comment:3 Changed 7 years ago by simonmar

  • Architecture changed from Multiple to Unknown/Multiple
Note: See TracTickets for help on using tickets.