Opened 6 years ago

Last modified 4 years ago

#8319 new bug

Simplifier ticks exhausted (need -fsimpl-tick-factor=955)

Reported by: ruudkoot Owned by:
Priority: normal Milestone:
Component: Test Suite Version: 7.6.3
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Compile-time crash Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


Attached file needs a rather high simpl-tick-factor (955) in order to compile.

Attachments (1)

Test.hs (2.1 KB) - added by ruudkoot 6 years ago.

Download all attachments as: .zip

Change History (5)

Changed 6 years ago by ruudkoot

Attachment: Test.hs added

comment:1 in reply to:  description Changed 6 years ago by ruudkoot

$ ghc --make -O2 Test.hs

[1 of 1] Compiling Main             ( Test.hs, Test.o )

ghc: panic! (the 'impossible' happened)
  (GHC version 7.6.3 for x86_64-unknown-linux):
	Simplifier ticks exhausted
    When trying UnfoldingDone $w$j{v s3DM} [lid]
    To increase the limit, use -fsimpl-tick-factor=N (default 100)
    If you need to do this, let GHC HQ know, and what factor you needed
    To see detailed counts use -ddump-simpl-stats
    Total ticks: 183945
Last edited 6 years ago by simonpj (previous) (diff)

comment:2 Changed 6 years ago by simonpj

I've found out what is going on. (What follows is an aide-memoire for me.)

There is a huge function of this form:

  f = \x -> let BIG BIG BIG
            in case ... of 
                  p1 -> (# a, b, c, d #)
                  p2 -> (# a, b, c, d #)
                  p2 -> (# a, b, c, d #)

As things stand, in CoreUnfold, unboxed tuples don't count towards the size of the express, but DO count towards the result discount. See Note [Unboxed tuple size and result discount]. As a result, functions like f can be very big, but have a massive result discount, and hence can be inlined like crazy.

This blows up the size of the test program.

The obvious solution is to nuke the discount, but I need check performance runs carefully. This comment just records my progress.

comment:3 Changed 5 years ago by thomie

This code compiles with ghc-7.8.1, ghc-7.8.3 and ghc-7.9.20141115, using -O2.

Should a regression test be added? Note that the code imports QuickCheck. Without it, the bug is not triggered.

comment:4 Changed 4 years ago by thomie

Component: CompilerTest Suite

Bug is fixed. Just needs a test.

Note: See TracTickets for help on using tickets.