Skip to content

GHC crash (panic) with -O2 and nonexistent .hi

14:13:47 | morn@ald:~/dev/darcs/prims-v3 -> ghc test.hs   
[1 of 1] Compiling Test             ( test.hs, test.o )
14:13:51 | morn@ald:~/dev/darcs/prims-v3 -> ghc -O2 test.hs
14:13:52 | morn@ald:~/dev/darcs/prims-v3 -> rm test.{hi,o} 
14:14:03 | morn@ald:~/dev/darcs/prims-v3 -> ghc -O2 test.hs
[1 of 1] Compiling Test             ( test.hs, test.o )
ghc: panic! (the 'impossible' happened)
  (GHC version 7.0.3 for i386-unknown-linux):
        funResultTy
    <pred>main:Test.ApplyState{tc rrv} p{tv aBn} [sk]
            ~
          hashed-storage-0.5.7:Storage.Hashed.Tree.Tree{tc r4Y}

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

I am attaching the test.hs that causes this. It needs hashed-storage and mtl from hackage to build, but otherwise it should be fairly minimal. I suppose I could cut it down further to only need mtl, but I already spent an hour tracking this down instead of getting work done. If you do need a further cutdown, let me know though, and I can try.

14:12:26 | morn@ald:~ -> ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.0.3

(GHC installed from Debian packages)

Edited by Ian Lynagh -
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information