#7241: GHC-7.6.1 panics on template haskell code
--------------------------------+-------------------------------------------
Reporter: akamaus | Owner:
Type: bug | Status: new
Priority: normal | Component: Compiler
Version: 7.6.1 | Keywords:
Os: Unknown/Multiple | Architecture: Unknown/Multiple
Failure: Compile-time crash | Testcase:
Blockedby: | Blocking:
Related: |
--------------------------------+-------------------------------------------
While experimenting with TH I stumbled upon a repeating compiler panic.
After minifying I got this example which triggers the failure:
{{{
% cat Peekler.hs
module Peekler where
import Language.Haskell.TH
tst = do
o <- newName "Foo"
return $ [DataD [] o [] [RecC o []] [''Show]]
}}}
{{{
% cat PeeklerTest.hs
module PeeklerTest where
import Peekler
$(tst)
test = print Foo
}}}
{{{
% ghci -XTemplateHaskell PeeklerTest.hs
GHCi, version 7.6.1: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
[1 of 2] Compiling Peekler ( Peekler.hs, interpreted )
[2 of 2] Compiling PeeklerTest ( PeeklerTest.hs, interpreted )
Loading package pretty-1.1.1.0 ... linking ... done.
Loading package array-0.4.0.1 ... linking ... done.
Loading package deepseq-1.3.0.1 ... linking ... done.
Loading package containers-0.5.0.0 ... linking ... done.
Loading package template-haskell ... linking ... done.
ghc: panic! (the 'impossible' happened)
(GHC version 7.6.1 for i386-unknown-linux):
lookupExactOcc
<<details unavailable>>
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
>
Leaving GHCi.
}}}
{{{
% ghc -XTemplateHaskell PeeklerTest.hs
[1 of 2] Compiling Peekler ( Peekler.hs, Peekler.o )
[2 of 2] Compiling PeeklerTest ( PeeklerTest.hs, PeeklerTest.o )
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package pretty-1.1.1.0 ... linking ... done.
Loading package array-0.4.0.1 ... linking ... done.
Loading package deepseq-1.3.0.1 ... linking ... done.
Loading package containers-0.5.0.0 ... linking ... done.
Loading package template-haskell ... linking ... done.
ghc: panic! (the 'impossible' happened)
(GHC version 7.6.1 for i386-unknown-linux):
lookupExactOcc
Foo_a18S{tc}
[main:PeeklerTest.Foo{tc a18S} defined at PeeklerTest.hs:5:3,
main:PeeklerTest.Foo{d a18S} defined at PeeklerTest.hs:5:3]
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
}}}
{{{
% lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04.1 LTS
Release: 12.04
Codename: precise
}}}
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7241>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs