#7239: GHC panic: MkExternalCore died: make_lit
--------------------------------------+-------------------------------------
    Reporter:  audunska               |       Owner:                    
        Type:  bug                    |      Status:  new               
    Priority:  normal                 |   Milestone:                    
   Component:  Compiler               |     Version:  7.4.1             
    Keywords:  panic, MkExternalCore  |          Os:  Linux             
Architecture:  x86_64 (amd64)         |     Failure:  Compile-time crash
  Difficulty:  Unknown                |    Testcase:                    
   Blockedby:                         |    Blocking:                    
     Related:                         |  
--------------------------------------+-------------------------------------
Changes (by simonpj):

  * difficulty:  => Unknown


Old description:

> 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
>
> Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
>
> 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.

New description:

 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.

--

Comment:

 Fixed by
 {{{
 commit 7b8a17ad3c0792f06ffa991e9e587f5458610a3c
 Author: Simon Peyton Jones <simo...@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)
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7239#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to