Panic Simplifier ticks exhausted since ghc 8
I'm getting a panic! in GHC 8.0.1 and in 8.1.20161028
sjoosten:ghcCompileBug sjc$ ghc-8.1.20161028 --make Factorize.hs -O2
[1 of 2] Compiling Factorize ( Factorize.hs, Factorize.o )
ghc: panic! (the 'impossible' happened)
(GHC version 8.1.20161028 for x86_64-apple-darwin):
Simplifier ticks exhausted
When trying UnfoldingDone $slast_s_s1IU
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: 18241
Call stack:
CallStack (from HasCallStack):
prettyCurrentCallStack, called at compiler/utils/Outputable.hs:1076:58 in ghc:Outputable
callStackDoc, called at compiler/utils/Outputable.hs:1080:37 in ghc:Outputable
pprPanic, called at compiler/simplCore/SimplMonad.hs:199:31 in ghc:SimplMonad
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
Attached is some code which I tried to make as small as possible (it therefore does not make sense, but it reproduces the panic). The panic! only occurs with -O2 (I need the -O2 switch to optimise the automatically generated Haskell code).