[GHC] #6078: GHC panic encountered for unlifted let bindings

GHC cvs-ghc at haskell.org
Sat May 5 00:30:26 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                |  
--------------------------------+-------------------------------------------
 The following code block makes GHC panic:

 {{{

 {-# LANGUAGE BangPatterns #-}
 module GhcPanic where

 import GHC.Ptr
 import Foreign

 -- Occurred in a really low-level bytestring decoder implementation.
 {-# INLINE byteStringSlice #-}
 byteStringSlice len = \fpbuf ip0 ipe s0 ->
     let ip1p@(Ptr ip1) = Ptr ip0 `plusPtr` len
     -- Note that the panic goes away if we use a bang-pattern as follows
     -- let !ip1p@(Ptr ip1) = Ptr ip0 `plusPtr` len
     in  ip1p
 }}}

 The panic output is

 {{{
 ghc-7.4.1 GhcPanic.hs
 [1 of 1] Compiling GhcPanic         ( GhcPanic.hs, GhcPanic.o )
 ghc: panic! (the 'impossible' happened)
   (GHC version 7.4.1 for x86_64-unknown-linux):
         dsLet: unlifted
     AbsBinds
     [( t{tv acU} [sk] :: ghc-prim:GHC.Prim.*{(w) tc 34d} )]
     []
     [( ip1p{v acI} [lid] :: forall ( t{tv acU} [sk] :: ghc-
 prim:GHC.Prim.*{(w) tc 34d} ).
                             base:GHC.Ptr.Ptr{tc 33A}
                               ( t{tv acU} [sk] :: ghc-prim:GHC.Prim.*{(w)
 tc 34d} ) ) <= ( ip1p{v acK} [lid] :: base:GHC.Ptr.Ptr{tc 33A}
 ( t{tv acU} [sk] :: ghc-prim:GHC.Prim.*{(w) tc 34d} ) )
        /\(@ ( t{tv acW} [sk] :: ghc-prim:GHC.Prim.*{(w) tc 34d} )).
        (<>) @ ( t{tv acW} [sk] :: ghc-prim:GHC.Prim.*{(w) tc 34d} ),
      ( ip1{v acJ} [lid] :: ghc-prim:GHC.Prim.Addr#{(w) tc 33} ) <= ( ip1{v
 acP} [lid] :: ghc-prim:GHC.Prim.Addr#{(w) tc 33} )
        (<>)
        @ (ghc-prim:GHC.Prim.Any{(w) tc 31N}
             ghc-prim:GHC.Prim.*{(w) tc 34d})]
       ( ip1p{v acI} [lid] :: forall ( t{tv acU} [sk] :: ghc-
 prim:GHC.Prim.*{(w) tc 34d} ).
                              base:GHC.Ptr.Ptr{tc 33A}
                                ( t{tv acU} [sk] :: ghc-prim:GHC.Prim.*{(w)
 tc 34d} ) )
         :: forall ( t{tv acU} [sk] :: ghc-prim:GHC.Prim.*{(w) tc 34d} ).
            base:GHC.Ptr.Ptr{tc 33A}
              ( t{tv acU} [sk] :: ghc-prim:GHC.Prim.*{(w) tc 34d} )
       [LclId]
       ( ip1{v acJ} [lid] :: ghc-prim:GHC.Prim.Addr#{(w) tc 33} )
         :: ghc-prim:GHC.Prim.Addr#{(w) tc 33}
       [LclId]
       {GhcPanic.hs:10:9-46}
       {GhcPanic.hs:10:9-22}
       {GhcPanic.hs:10:9-12}
       ( ip1p{v acK} [lid] :: base:GHC.Ptr.Ptr{tc 33A}
                                ( t{tv acU} [sk] :: ghc-prim:GHC.Prim.*{(w)
 tc 34d} ) )@({GhcPanic.hs:10:15-21}
 {GhcPanic.hs:10:15-17}
 base:GHC.Ptr.Ptr{d r3C}{EvBinds{}} ((( ip1{v acP} [lid] :: ghc-
 prim:GHC.Prim.Addr#{(w) tc 33} )
 :: ghc-prim:GHC.Prim.Addr#{(w) tc 33})))
         = {GhcPanic.hs:10:26-46}
           {GhcPanic.hs:10:34-42}
           (base:GHC.Ptr.plusPtr{v r3E})
           @ (ghc-prim:GHC.Prim.Any{(w) tc 31N}
                ghc-prim:GHC.Prim.*{(w) tc 34d})
           @ ( t{tv acU} [sk] :: ghc-prim:GHC.Prim.*{(w) tc 34d} )
             ((base:GHC.Ptr.Ptr{v r39})
              @ (ghc-prim:GHC.Prim.Any{(w) tc 31N}
                   ghc-prim:GHC.Prim.*{(w) tc 34d})
                ip0{v acF})
             len{v acD}
     EvBinds{}
     ( ip1p{v acI} [lid] :: forall ( t{tv acU} [sk] :: ghc-
 prim:GHC.Prim.*{(w) tc 34d} ).
                            base:GHC.Ptr.Ptr{tc 33A}
                              ( t{tv acU} [sk] :: ghc-prim:GHC.Prim.*{(w)
 tc 34d} ) )
       @ ( t{tv ad5} [sk] :: ghc-prim:GHC.Prim.*{(w) tc 34d} )

 Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

 }}}

 It might be that its an instance of #4498.

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



More information about the Glasgow-haskell-bugs mailing list