GHC: Ticket #2820: GADT code from RepLib causes panic!
http://ghc.haskell.org/trac/ghc/ticket/2820
<p>
While compiling RepLib generics library I encountered a ghc panic. I have isolated the failure to very small example that does some simple computation over a heterogenous list. I have attached the following files
</p>
<p>
RepMinimal.hs. This is the problem reduced to small example. The function that seems to cause the problem is "badFunction". If I remove this function the file compiles.
</p>
<p>
RepSmall.hs. This is a trimmed down core of RepLib where the original problem occurs. I only include it if someone looking at the bug wants to know what this code was used for.
</p>
<p>
below is the output of ghc run.
</p>
<hr />
<p>
[ben@lapdog RepLib]$ ghc -v RepCombined3.hs
Glasgow Haskell Compiler, Version 6.10.1, for Haskell 98, stage 2 booted by GHC version 6.10.1
Using package config file: /usr/lib/ghc-6.10.1/./package.conf
hiding package base-3.0.3.0 to avoid conflict with later version base-4.0.0.0
wired-in package ghc-prim mapped to ghc-prim-0.1.0.0
wired-in package integer mapped to integer-0.1.0.0
wired-in package base mapped to base-4.0.0.0
wired-in package rts mapped to rts-1.0
wired-in package haskell98 mapped to haskell98-1.0.1.0
wired-in package syb mapped to syb-0.1.0.0
wired-in package template-haskell mapped to template-haskell-2.3.0.0
wired-in package dph-seq mapped to dph-seq-0.3
wired-in package dph-par mapped to dph-par-0.3
Hsc static flags: -static
Created temporary directory: /tmp/ghc3284_0
<strong>* Checking old interface for main:Data.RepLib.RepCombined:
</strong>* Parser:
<strong>* Renamer/typechecker:
</strong>* Desugar:
</p>
<blockquote>
<p>
Result size = 176
</strong></p>
</blockquote>
<p>
<strong>* Simplify:
</p>
<blockquote>
<p>
Result size = 283
Result size = 283
</strong></p>
</blockquote>
<p>
<strong>* Tidy Core:
</p>
<blockquote>
<p>
Result size = 283
</strong></p>
</blockquote>
<p>
<strong>* CorePrep:
</p>
<blockquote>
<p>
Result size = 465
</strong></p>
</blockquote>
<p>
<strong>* Stg2Stg:
<strong>* CodeGen:
</strong>* CodeOutput:
<strong>* Deleting temp files:
Deleting: /tmp/ghc3284_0/ghc3284_0.s
</strong>* Deleting temp dirs:
Deleting: /tmp/ghc3284_0
ghc: panic! (the 'impossible' happened)
</p>
<blockquote>
<p>
(GHC version 6.10.1 for i386-unknown-linux):
</p>
<blockquote>
<p>
initC: srt_lbl
</p>
</blockquote>
</blockquote>
<p>
Please report this as a GHC bug: <a href="http://www.haskell.org/ghc/reportabug">http://www.haskell.org/ghc/reportabug</a>
</p>
<hr />
en-usGHChttp://ghc.haskell.org/trac/ghc/chrome/site/ghc_logo.png
http://ghc.haskell.org/trac/ghc/ticket/2820
Trac 1.0.9ben.kavanaghThu, 27 Nov 2008 16:18:51 GMTattachment set
http://ghc.haskell.org/trac/ghc/ticket/2820
http://ghc.haskell.org/trac/ghc/ticket/2820
<ul>
<li><strong>attachment</strong>
set to <em>RepMinimal.hs</em>
</li>
</ul>
<p>
Minimal example of failure. Failure seems to be related to compilation of 'badFunction'
</p>
Ticketben.kavanaghThu, 27 Nov 2008 16:21:47 GMTattachment set
http://ghc.haskell.org/trac/ghc/ticket/2820
http://ghc.haskell.org/trac/ghc/ticket/2820
<ul>
<li><strong>attachment</strong>
set to <em>RepSmall.hs</em>
</li>
</ul>
<p>
Cut down version of RepLib library core. This is to show where the problem code was used originally.
</p>
TicketsimonpjThu, 27 Nov 2008 16:22:50 GMTstatus changed; difficulty, resolution set
http://ghc.haskell.org/trac/ghc/ticket/2820#comment:1
http://ghc.haskell.org/trac/ghc/ticket/2820#comment:1
<ul>
<li><strong>status</strong>
changed from <em>new</em> to <em>closed</em>
</li>
<li><strong>difficulty</strong>
set to <em>Unknown</em>
</li>
<li><strong>resolution</strong>
set to <em>duplicate</em>
</li>
</ul>
<p>
Thank you for boiling this down. It turns out to be a dup of <a class="closed ticket" href="http://ghc.haskell.org/trac/ghc/ticket/2799" title="merge: Panic (core lint failure) with GADTs, GHC 6.10.1 (closed: fixed)">#2799</a>, reported a few days ago, which I fixed yesterday.
</p>
<p>
Simon
</p>
Ticket