[GHC] #14650: Panic with no extensions (StgCmmEnv: variable not found)

GHC ghc-devs at haskell.org
Tue Jan 9 01:10:56 UTC 2018


#14650: Panic with no extensions (StgCmmEnv: variable not found)
-------------------------------------+-------------------------------------
           Reporter:  Zemyla         |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.2.2
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:  x86_64         |   Type of failure:  Compile-time
  (amd64)                            |  crash or panic
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 When I compile the attached Haskell program with `-O2`, or `-O1` with
 `-fspec-constr` added, I get a compiler panic:

 {{{
 ghc: panic! (the 'impossible' happened)
   (GHC version 8.2.2 for x86_64-unknown-mingw32):
         StgCmmEnv: variable not found
   $smergeSplit_s3bq
   local binds for:
   $WLL
   $W:%
   $W:&
   cmp_s3ox
   eta_s3oy
   $wmergeLL_s3oz
   $s$wpush_s3pZ
   $wpush_s3q0
   $s$wmergeAll_s3rl
   $wmergeAll_s3rR
   $wsplitDesc_s3sp
   $wsplitAsc_s3sC
   mergeSplit_s3tt
   ss_s3tu
   ds_s3tv
   wild_s3tw
   a1_s3tC
   as'_s3tD
   wild1_s3tE
   b_s3tF
   bs_s3tG
   wild2_s3tH
   ww1_s3tJ
   ww2_s3tK
   ww3_s3tL
   ww4_s3tM
   ww6_s3tO
   ww7_s3tP
   ww8_s3tQ
   ww9_s3tR
   Call stack:
       CallStack (from HasCallStack):
         prettyCurrentCallStack, called at
 compiler\utils\Outputable.hs:1133:58 in ghc:Outputable
         callStackDoc, called at compiler\utils\Outputable.hs:1137:37 in
 ghc:Outputable
         pprPanic, called at compiler\codeGen\StgCmmEnv.hs:147:9 in
 ghc:StgCmmEnv
 }}}

 I ran it with `-dcore-lint`, and it gives the following messages (full
 .lint attached):

 {{{
 *** Core Lint errors : in result of Simplifier ***
 <no location info>: warning:
     In the expression: jump $smergeSplit_s3bN
                          ww_s34F ww_s34Q ww_s34R ww_s34S ww_s34T
     $smergeSplit_s3bN [Occ=LoopBreaker]
       :: [a_a23n] -> Int# -> Bool -> [a_a23n] -> Stack a_a23n -> [a_a23n]
     [LclId[JoinId(5)],
      Arity=5,
      Str=<S,U><L,U><L,U><L,U><L,U>,
      Unf=Unf{Src=<vanilla>, TopLvl=False, Value=True, ConLike=True,
              WorkFree=True, Expandable=True,
              Guidance=IF_ARGS [80 0 0 0 0] 554 0}] is out of scope
 <no location info>: warning:
     In the expression: jump $smergeSplit_s3bN
                          ww_s34F ww_s34Q ww_s34R ww_s34S ww_s34T
     Invalid occurrence of a join variable: $smergeSplit_s3bN
     The binder is either not a join point, or not valid here
 <no location info>: warning:
     In the expression: jump $smergeSplit_s3bN
                          ww_s34K ww_s34Q ww_s34R ww_s34S ww_s34T
     $smergeSplit_s3bN [Occ=LoopBreaker]
       :: [a_a23n] -> Int# -> Bool -> [a_a23n] -> Stack a_a23n -> [a_a23n]
     [LclId[JoinId(5)],
      Arity=5,
      Str=<S,U><L,U><L,U><L,U><L,U>,
      Unf=Unf{Src=<vanilla>, TopLvl=False, Value=True, ConLike=True,
              WorkFree=True, Expandable=True,
              Guidance=IF_ARGS [80 0 0 0 0] 554 0}] is out of scope
 <no location info>: warning:
     In the expression: jump $smergeSplit_s3bN
                          ww_s34K ww_s34Q ww_s34R ww_s34S ww_s34T
     Invalid occurrence of a join variable: $smergeSplit_s3bN
     The binder is either not a join point, or not valid here
 }}}

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


More information about the ghc-tickets mailing list