Skip to content

Ghc panics 'ASSERT failed! file compiler/typecheck/TcTyFuns.lhs line 318' when compiling my ghc tree.

In the middle of the work on GHC backend I triggered a bug in GHC. After discussing with simonpj, I have snapshotted the source tree, as I could not reduce the test case.

When compiled the stage 1 compiler with -DDEBUG, ghc-stage1 compiler panics when compiling stage 2. It is enough to invoke 'make' in the tree to get following compilation error:

ghc-stage1: panic! (the 'impossible' happened)
  (GHC version 6.13 for x86_64-unknown-linux):
        ASSERT failed! file compiler/typecheck/TcTyFuns.lhs line 318
[Wanted t_a1KB{tv} [tau] :: hoopl-3.8.0.0:Compiler.Hoopl.Dataflow.Fact{tc raN}
                              x{tv a1Ks} [sk] ghc-6.13:CmmSpillReload.DualLive{tc r11W}
                              ~
                            hoopl-3.8.0.0:Compiler.Hoopl.Dataflow.Fact{tc raN}
                              x{tv a1Ks} [sk] f{tv a1Kt} [tau]]

The file causing the bug is compiler/cmm/CmmSpillReload.hs. On line 271, there is a description of a change that makes the source compile.

This is different to #4044 (closed):

Milan managed to find a way to change the source code to avoid both bugs.

Edited by Simon Peyton Jones
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information