I've tried to compile my vinyl-like records with 7.10.2-rc1 and got:
ghc: panic! (the 'impossible' happened) (GHC version 7.10.1.20150612 for x86_64-unknown-linux): Simplifier ticks exhausted When trying RuleFired Class op rreplace 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: 225484Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
Attached self contained test compiles with 7.10.1, but fails with 7.10.2-rc1 when compiled with optimizations.
Trac metadata
Trac field
Value
Version
7.10.1-rc1
Type
Bug
TypeOfFailure
OtherFailure
Priority
normal
Resolution
Unresolved
Component
Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items
0
Show closed items
GraphQL error: The resource that you are attempting to access does not exist or you don't have permission to perform this action
No child items are currently open.
Linked items
0
Link issues together to show that they're related or that one is blocking others.
Learn more.
$ /opt/ghc/7.10.1/bin/ghc -O -fforce-recomp Bug.hs -fsimpl-tick-factor=50 [1 of 1] Compiling Bug ( Bug.hs, Bug.o )$ /opt/ghc/7.10.2/bin/ghc -O -fforce-recomp Bug.hs -fsimpl-tick-factor=5000 [1 of 1] Compiling Bug ( Bug.hs, Bug.o )ghc: panic! (the 'impossible' happened) (GHC version 7.10.1.20150609 for x86_64-unknown-linux): Simplifier ticks exhausted When trying UnfoldingDone $fFunctorConst_$cfmap 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: 11274000
I am still churning through this one but I think I finally have some traction. In 7.10.2 each field added to the records roughly doubles the simpl-tick-factor necessary to finish.
I am now comparing the sequences of inlinings performed by GHC 7.10.1 and 7.10.2. For those following along at home, it is enlightening (albeit verbose) to compile like this,
One notices certain patterns in this output. In particular, one finds inlinings of Data.Functor.Identity.$fFoldableIdentity2 are performed far more often in 7.10.1 than 7.10.2. It is worth noting that whenever 7.10.2 considers inlining this definition it does so.
Notice the second "frame" of the context: ApplyToVal nodup ((g x) ...) (7.10.1) in contrast to ApplyToVal simpl ((g x) ...) (7.10.2). I'm not yet sure whether this is significant.
I have also noticed that GHC 7.10.1 often appears to by simplifying inside of a cast when 7.10.2 is just working inside of Const. For instance, it is common to see the SimplCont of 7.10.1 terminates with,
One obvious qualitative difference between the two simplifier trajectories is that the 7.10.2 emits its last SimplBind trace (for $s$crsubset_s2gQ) somewhere around 13% through the log (measured in lines). In contrast, 7.10.1 emits SimplBinds every regularly throughout the log. I suppose this means that 7.10.2 is spending most of its time playing with this one top-level binding?
Well, I quickly bisected get an idea of what I should be looking for. It seems like the regression was introduced by the fix for the huge space leak in the mighty simplifier (8af219ad). If I understand correctly this patch touched code surrounding the treatment of interesting arguments. Perhaps an inadvertent change here is now resulting in more inlining than we would like. I'll have another look after I've slept on it to see if this revelation gets us any closer to a fix.