[GHC] #6078: GHC panic encountered for unlifted let bindings
GHC
cvs-ghc at haskell.org
Sat May 5 21:54:29 CEST 2012
#6078: GHC panic encountered for unlifted let bindings
--------------------------------+-------------------------------------------
Reporter: SimonMeier | Owner:
Type: bug | Status: new
Priority: normal | Component: Compiler
Version: 7.4.1 | Keywords: unlifted, bang patterns
Os: Unknown/Multiple | Architecture: Unknown/Multiple
Failure: Compile-time crash | Testcase:
Blockedby: | Blocking:
Related: 4498 |
--------------------------------+-------------------------------------------
Comment(by michalt):
Thanks for reporting! I can reproduce this with HEAD. When pattern
matching
unlifted types one must use the bang, have a look at: #2806. So the code
should
use the ```!```.
Now what goes wrong with GHC is that it does not reject the program but
goes on
and tries to compile it (and only tries to warn about it, see #3278). As
far as
I can see (which might be wrong), there are a few things happening:
* the binding ```ip1p``` gets generalized and so the pattern is
represented by
```AbsBinds```
* the fix for #4498 makes bang pattern bindings monomorphic (but
obviously only
works if there are bang patterns, so it doesn't apply here; see
```decideGeneralisationPlan```
source:compiler/typecheck/TcBinds.lhs#L1175)
* this causes the error when ```dsStrictBind``` is called
source:compiler/deSugar/DsExpr.lhs#L159
I guess the right fix would be to reject the program -- there's a note in
source:compiler/typecheck/TcBinds.lhs#L1260
{{{
-- This should be a checkTc, not a warnTc, but as of GHC 6.11
-- the versions of alex and happy available have non-conforming
-- templates, so the GHC build fails if it's an error:
; warnUnlifted <- woptM Opt_WarnLazyUnliftedBindings
; warnTc (warnUnlifted && not bang_pat && lifted_pat)
}}}
but the comment seems to still apply to current HEAD, i.e. the build fails
on
code generated by Happy and Alex. If I have time, I'll try to have a look
if it
would be difficult to fix them.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/6078#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list