Ticket #7239 (closed bug: fixed)

Opened 8 months ago

Last modified 7 months ago

GHC panic: MkExternalCore died: make_lit

Reported by: audunska Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.4.1
Keywords: panic, MkExternalCore Cc: audun@…
Operating System: Linux Architecture: x86_64 (amd64)
Type of failure: Compile-time crash Difficulty: Unknown
Test Case: ext-core/T7239 Blocked By:
Blocking: Related Tickets:

Description (last modified by simonpj) (diff)

Compiling the attached example with -fext-core crashes ghc with the following text:

$ ghc -fext-core min.hs
[1 of 1] Compiling Main             ( min.hs, min.o )
ghc: panic! (the 'impossible' happened)
  (GHC version 7.4.1 for x86_64-unknown-linux):
	MkExternalCore died: make_lit

Replacing the data declaration with a newtype or a library type such as Complex or Ratio gives the same crash. An empty .hcr file is created.

Replacing the "main" action with "return ()" or removing one of the type synonym declarations makes the crash go away.

This is using the ghc package distributed with ubuntu 12.04.

Attachments

min.hs Download (80 bytes) - added by audunska 8 months ago.
Minimal triggering example

Change History

Changed 8 months ago by audunska

Minimal triggering example

Changed 8 months ago by audunska

  • cc audun@… added

Changed 8 months ago by simonpj

  • difficulty set to Unknown
  • description modified (diff)

Fixed by

commit 7b8a17ad3c0792f06ffa991e9e587f5458610a3c
Author: Simon Peyton Jones <simonpj@microsoft.com>
Date:   Sat Sep 15 23:12:23 2012 +0100

    Print literal integers in External Core.

>---------------------------------------------------------------

 compiler/coreSyn/MkExternalCore.lhs |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/compiler/coreSyn/MkExternalCore.lhs b/compiler/coreSyn/MkExternalCore.lhs
index d05da2a..2103708 100644
--- a/compiler/coreSyn/MkExternalCore.lhs
+++ b/compiler/coreSyn/MkExternalCore.lhs
@@ -229,7 +229,8 @@ make_lit dflags l =
     MachWord64 i -> C.Lint i t
     MachFloat r -> C.Lrational r t
     MachDouble r -> C.Lrational r t
-    _ -> error "MkExternalCore died: make_lit"
+    LitInteger i _ -> C.Lint i t
+    _ -> pprPanic "MkExternalCore died: make_lit" (ppr l)
   where 
     t = make_ty dflags (literalType l)

Changed 8 months ago by simonpj

  • status changed from new to merge
  • testcase set to ext-core/T7239

Test added.

Changed 7 months ago by igloo

  • status changed from merge to closed
  • resolution set to fixed

Merged as 8a767d8be37e6ab437dfcb92bfe543e9f4901c99

Note: See TracTickets for help on using tickets.