[GHC] #12709: GHC panic

GHC ghc-devs at haskell.org
Sat Oct 15 03:54:39 UTC 2016


#12709: GHC panic
-------------------------------------+-------------------------------------
           Reporter:  Iceland_jack   |             Owner:
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.0.1
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 I get

 {{{
 $ ./ghc-stage2 -ignore-dot-ghci --interactive /tmp/tEZm.hs
 GHCi, version 8.1.20160930: http://www.haskell.org/ghc/  :? for help
 [1 of 1] Compiling Main             ( /tmp/tEZm.hs, interpreted )
 ghc-stage2: panic! (the 'impossible' happened)
   (GHC version 8.1.20160930 for x86_64-unknown-linux):
         kindPrimRep.go
   rep_a13E
   Call stack:
       CallStack (from HasCallStack):
         prettyCurrentCallStack, called at
 compiler/utils/Outputable.hs:1076:58 in ghc:Outputable
         callStackDoc, called at compiler/utils/Outputable.hs:1080:37 in
 ghc:Outputable
         pprPanic, called at compiler/simplStg/RepType.hs:369:9 in
 ghc:RepType
         kindPrimRep, called at compiler/simplStg/RepType.hs:337:18 in
 ghc:RepType
         typePrimRep, called at compiler/ghci/ByteCodeGen.hs:1541:15 in
 ghc:ByteCodeGen

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

 >
 }}}

 running

 {{{#!hs
 {-# Language MagicHash, PolyKinds, ViewPatterns, TypeInType,
 RebindableSyntax, NoImplicitPrelude #-}

 import GHC.Types
 import Prelude hiding (Num (..))
 import qualified Prelude as P
 import GHC.Prim

 data BoxUnbox = BUB Int Int#

 class Num (a :: TYPE rep) where
   (+) :: a -> a -> a

   fromInteger :: Integer -> a

 instance Num Int where
   (+) = (P.+)
   fromInteger = P.fromInteger

 instance Num Int# where
   (+) = (+#)
   fromInteger (fromInteger -> I# n) = n

 a :: BoxUnbox
 a = let u :: Num (a :: TYPE rep) => a
         u = 1 + 2 + 3 + 4
      in
         BUB u u
 }}}

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


More information about the ghc-tickets mailing list