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

#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=

#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 Resolution: | 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: | -------------------------------------+------------------------------------- Changes (by Zemyla): * Attachment "MergeSort.zip" added. .Offending program and full core lint for that file -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14650 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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 Resolution: | 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: | -------------------------------------+------------------------------------- Comment (by Zemyla): Oh, I forgot to mention that, when I remove `{-# INLINABLE mergeSplit #-}`, the crash disappears. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14650#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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 Resolution: | 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: | -------------------------------------+------------------------------------- Comment (by simonpj): I'm on this. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14650#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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
Resolution: | 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: |
-------------------------------------+-------------------------------------
Comment (by Simon Peyton Jones

#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
Resolution: | 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: |
-------------------------------------+-------------------------------------
Comment (by Simon Peyton Jones

#14650: Panic with no extensions (StgCmmEnv: variable not found) -------------------------------------+------------------------------------- Reporter: Zemyla | Owner: (none) Type: bug | Status: merge Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 | (amd64) Type of failure: Compile-time | Test Case: crash or panic | simplCore/should_compile/T14650.hs Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonpj): * status: new => merge * testcase: => simplCore/should_compile/T14650.hs Comment: Thanks for a great report. Now fixed. Worth merging "Fix join-point decision". (The other patch doesn't fix an outright bug.) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14650#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14650: Panic with no extensions (StgCmmEnv: variable not found) -------------------------------------+------------------------------------- Reporter: Zemyla | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.4.1 Component: Compiler | Version: 8.2.2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 | (amd64) Type of failure: Compile-time | Test Case: crash or panic | simplCore/should_compile/T14650.hs Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed * milestone: => 8.4.1 Comment: comment:3 merged in 20afdaa75e269697c2f9608e6d29f720a6387d01. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14650#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC