Skip to content

Simplifier ticks exhausted with complex list literal.

So I had a working version of a module that was too slow: https://github.com/Lokathor/ludolib/blob/6e69f87762c88d7909ca259ffe69141ea4b707c0/src/Util/AutomataGen.hs#L167

and then I tried to rearrange things so that the checking could short-circuit a bit and run faster. I came up with this: https://gist.github.com/Lokathor/d1e4a8cd6268835a2403423fb180a71d#file-automatagencrashesghc-hs-L172

Which loads and runs just fine in GHCi, but then when I go to compile it into a binary for benchmarking I got the following:

ghc.exe: panic! (the 'impossible' happened)
  (GHC version 7.10.3 for x86_64-unknown-mingw32):
        Simplifier ticks exhausted
  When trying UnfoldingDone a_siVC
  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: 294802

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

Setting the factor up to 1k caused it to crash out with the same problem. Setting the factor up to 10k caused GHC to just eat up nearly all of my RAM (11GB) and then stall out until I killed it a few minutes later.

I tried not using -O2 during compilation, but it had the same problem anyway. With some IRC help, it was suggested to add the -fsimple-list-literals flag, which makes things compile and run just fine (and with the speed gain that I'd hoped for).

So things work now, for some definition of "work", though I was advised to report this bad behavior anyway.

Trac metadata
Trac field Value
Version 7.10.3
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