#7023: Panic when compiling with -fdefer-type-errors
--------------------------------+-------------------------------------------
Reporter: guest | Owner:
Type: bug | Status: new
Priority: normal | Component: Compiler
Version: 7.5 | Keywords:
Os: MacOS X | Architecture: Unknown/Multiple
Failure: Compile-time crash | Testcase:
Blockedby: | Blocking:
Related: |
--------------------------------+-------------------------------------------
Changes (by dreixel):
* architecture: x86_64 (amd64) => Unknown/Multiple
Comment:
I can confirm this. Compilation fails with:
{{{
ghc-stage2: panic! (the 'impossible' happened)
(GHC version 7.5 for i386-unknown-linux):
cgLookupPanic (probably invalid Core; try -dcore-lint)
cobox{v ahw} [lid]
static binds for:
local binds for:
}}}
`-dcore-lint` gives us:
{{{
[1 of 1] Compiling Main ( Bug.hs, Bug.o )
*** Core Lint errors : in result of Desugar (after optimization) ***
<no location info>: Warning:
In the expression: GHC.Types.:
@ [GHC.Types.Char]
(case cobox_ahw of _ { GHC.Types.Eq# cobox_dir ->
(GHC.Types.I# 1)
`cast` (cobox_dir :: GHC.Types.Int ~#
[GHC.Types.Char])
})
(GHC.Types.[] @ [GHC.Types.Char])
cobox_ahw :: GHC.Types.Int ~ [GHC.Types.Char]
[LclId] is out of scope
*** Offending Program ***
Rec {
Main.a :: [[GHC.Types.Char]]
[LclIdX]
Main.a =
GHC.Types.:
@ [GHC.Types.Char]
(GHC.Types.:
@ GHC.Types.Char
(GHC.Types.C# 'x')
(GHC.Types.[] @ GHC.Types.Char))
(GHC.Types.:
@ [GHC.Types.Char]
(case cobox_ahw of _ { GHC.Types.Eq# cobox_dir ->
(GHC.Types.I# 1)
`cast` (cobox_dir :: GHC.Types.Int ~# [GHC.Types.Char])
})
(GHC.Types.[] @ [GHC.Types.Char]))
Main.main :: GHC.Types.IO ()
[LclIdX]
Main.main =
System.IO.putStrLn (GHC.CString.unpackCString# "Hello World")
:Main.main :: GHC.Types.IO ()
[LclIdX]
:Main.main = GHC.TopHandler.runMainIO @ () Main.main
end Rec }
*** End of Offense ***
<no location info>:
Compilation had errors
}}}
I'm not entirely sure what's going on, though. Why did `cobox_ahw` not get
replaced by its evidence (a runtime error)?
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7023#comment:2>
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