Opened 9 years ago

Closed 9 years ago

#5315 closed bug (fixed)

panic in idInfoToAmode with -O

Reported by: mikhail.vorozhtsov Owned by:
Priority: high Milestone: 7.2.1
Component: Compiler Version: 7.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Compile-time crash Test Case: simplCore/should_run/T5315
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


The attached program causes GHC panic:

$ ghc-7.3.20110710 -O -fforce-recomp HList.hs
[1 of 1] Compiling Main             ( HList.hs, HList.o )
ghc: panic! (the 'impossible' happened)
  (GHC version 7.3.20110710 for x86_64-unknown-linux):
	idInfoToAmode: void ww{v s1UG} [lid]

Please report this as a GHC bug:

Not passing -O or commenting out hNth (Next p) l = ... makes the panic disappear.

Attachments (1)

HList.hs (2.3 KB) - added by mikhail.vorozhtsov 9 years ago.

Download all attachments as: .zip

Change History (6)

Changed 9 years ago by mikhail.vorozhtsov

Attachment: HList.hs added

comment:1 Changed 9 years ago by simonmar

Milestone: 7.2.1
Priority: normalhigh

Is this a regression?

comment:2 in reply to:  1 Changed 9 years ago by mikhail.vorozhtsov

Replying to simonmar:

Is this a regression?

Probably no. If I remove the equality superclass "l ~ (HHead l :* HTail l)" from the HNonEmpty class declaration the panic goes away. Equality constraints in class contexts were implemented just recently.

comment:3 Changed 9 years ago by simonpj@…

commit ce8c84a76d0a19ff56d4c4e58744776fda2044bd
Author: Simon Peyton Jones <>
Date:   Fri Jul 15 11:49:38 2011 +0100

    Use varToCoreExpr rather than Var (fixes #5315)
    A coercion variable in a term must be wrapped in a coercion!
    (Led to lint errors.)

comment:4 Changed 9 years ago by simonpj

Status: newmerge
Test Case: simplCore/should_run/T5315

Thanks for the report. It's a real bug.

Pls merge to 7.2

comment:5 Changed 9 years ago by igloo

Resolution: fixed
Status: mergeclosed
Note: See TracTickets for help on using tickets.