[GHC] #11414: Panic with -XStrict: StgCmmEnv: variable not found

#11414: Panic with -XStrict: StgCmmEnv: variable not found -------------------------------------+------------------------------------- Reporter: thomie | Owner: Type: bug | Status: new Priority: high | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Keywords: Strict | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- {{{ {-# LANGUAGE Strict #-} main = print $ let x = undefined in True }}} Using HEAD or GHC 8.0: {{{ $ ghc-8.0.0.20160109 Test.hs [1 of 1] Compiling Main ( Test.hs, Test.o ) ghc: panic! (the 'impossible' happened) (GHC version 8.0.0.20160109 for x86_64-unknown-linux): StgCmmEnv: variable not found $dIP_aDK local binds for: Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}} Using a devel2 build: {{{ $ ./inplace/bin/ghc-stage2 Test.hs [1 of 1] Compiling Main ( Test.hs, Test.o ) WARNING: file compiler/simplCore/OccurAnal.hs, line 66 Glomming in Main: [aDO :->] WARNING: file compiler/coreSyn/CoreSubst.hs, line 278 CoreSubst.lookupIdSubst simpleOptExpr $dIP_aDO InScope [aDM :-> a_aDM] WARNING: file compiler/simplCore/OccurAnal.hs, line 66 Glomming in Main: [aDO :-> Once] WARNING: file compiler/simplCore/SimplEnv.hs, line 530 $dIP_aDO WARNING: file compiler/simplCore/OccurAnal.hs, line 66 Glomming in Main: [aDO :-> Once] WARNING: file compiler/simplCore/SimplEnv.hs, line 530 $dIP_aDO ghc-stage2: panic! (the 'impossible' happened) (GHC version 8.1.20160103 for x86_64-unknown-linux): ASSERT failed! file compiler/stgSyn/CoreToStg.hs line 1025 $dIP_aDO Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11414 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11414: Panic with -XStrict: StgCmmEnv: variable not found -------------------------------------+------------------------------------- Reporter: thomie | Owner: Type: bug | Status: new Priority: high | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Resolution: | Keywords: Strict Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by adamse): Did some very quick testing. At 77ef1a0895b3bfa9236705f4e5ffcd46d6e19ff8 (Dec 14) there is no error: {{{ % ./inplace/bin/ghc-stage2 Test.hs [1 of 1] Compiling Main ( Test.hs, Test.o ) Linking Test ... }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11414#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11414: Panic with -XStrict: StgCmmEnv: variable not found -------------------------------------+------------------------------------- Reporter: thomie | Owner: Type: bug | Status: new Priority: high | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Resolution: | Keywords: Strict Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: T11414 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * testcase: => T11414 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11414#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11414: Panic with -XStrict: StgCmmEnv: variable not found -------------------------------------+------------------------------------- Reporter: thomie | Owner: Type: bug | Status: new Priority: highest | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Resolution: | Keywords: Strict Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: T11414 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * priority: high => highest Old description:
{{{ {-# LANGUAGE Strict #-} main = print $ let x = undefined in True }}}
Using HEAD or GHC 8.0: {{{ $ ghc-8.0.0.20160109 Test.hs [1 of 1] Compiling Main ( Test.hs, Test.o ) ghc: panic! (the 'impossible' happened) (GHC version 8.0.0.20160109 for x86_64-unknown-linux): StgCmmEnv: variable not found $dIP_aDK local binds for:
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}}
Using a devel2 build: {{{ $ ./inplace/bin/ghc-stage2 Test.hs [1 of 1] Compiling Main ( Test.hs, Test.o ) WARNING: file compiler/simplCore/OccurAnal.hs, line 66 Glomming in Main: [aDO :->] WARNING: file compiler/coreSyn/CoreSubst.hs, line 278 CoreSubst.lookupIdSubst simpleOptExpr $dIP_aDO InScope [aDM :-> a_aDM] WARNING: file compiler/simplCore/OccurAnal.hs, line 66 Glomming in Main: [aDO :-> Once] WARNING: file compiler/simplCore/SimplEnv.hs, line 530 $dIP_aDO WARNING: file compiler/simplCore/OccurAnal.hs, line 66 Glomming in Main: [aDO :-> Once] WARNING: file compiler/simplCore/SimplEnv.hs, line 530 $dIP_aDO ghc-stage2: panic! (the 'impossible' happened) (GHC version 8.1.20160103 for x86_64-unknown-linux): ASSERT failed! file compiler/stgSyn/CoreToStg.hs line 1025 $dIP_aDO
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}}
New description: {{{#!hs {-# LANGUAGE Strict #-} main = print $ let x = undefined in True }}} Using HEAD or GHC 8.0: {{{ $ ghc-8.0.0.20160109 Test.hs [1 of 1] Compiling Main ( Test.hs, Test.o ) ghc: panic! (the 'impossible' happened) (GHC version 8.0.0.20160109 for x86_64-unknown-linux): StgCmmEnv: variable not found $dIP_aDK local binds for: Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}} Using a devel2 build: {{{ $ ./inplace/bin/ghc-stage2 Test.hs [1 of 1] Compiling Main ( Test.hs, Test.o ) WARNING: file compiler/simplCore/OccurAnal.hs, line 66 Glomming in Main: [aDO :->] WARNING: file compiler/coreSyn/CoreSubst.hs, line 278 CoreSubst.lookupIdSubst simpleOptExpr $dIP_aDO InScope [aDM :-> a_aDM] WARNING: file compiler/simplCore/OccurAnal.hs, line 66 Glomming in Main: [aDO :-> Once] WARNING: file compiler/simplCore/SimplEnv.hs, line 530 $dIP_aDO WARNING: file compiler/simplCore/OccurAnal.hs, line 66 Glomming in Main: [aDO :-> Once] WARNING: file compiler/simplCore/SimplEnv.hs, line 530 $dIP_aDO ghc-stage2: panic! (the 'impossible' happened) (GHC version 8.1.20160103 for x86_64-unknown-linux): ASSERT failed! file compiler/stgSyn/CoreToStg.hs line 1025 $dIP_aDO Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}} -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11414#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11414: Panic with -XStrict: StgCmmEnv: variable not found -------------------------------------+------------------------------------- Reporter: thomie | Owner: Type: bug | Status: new Priority: highest | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Resolution: | Keywords: Strict Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: T11414 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): It appears that the issue is introduced quite early in compilation as the output from desugaring fails core lint, {{{ *** Core Linted result of Desugar (after optimization): *** Core Lint errors : in result of Desugar (after optimization) *** <no location info>: warning: In the expression: (\ (@ a_aKO) -> undefined) @ a_aKO @ 'Lifted @ a_aKO $dIP_aKQ $dIP_aKQ :: ?callStack::CallStack [LclId, Str=DmdType] is out of scope *** Offending Program *** main :: IO () [LclIdX, Str=DmdType] main = $ @ 'Lifted @ Bool @ (IO ()) (print @ Bool $fShowBool) (case \ (@ a_aKO) -> (\ (@ a_aKO) -> undefined) @ a_aKO @ 'Lifted @ a_aKO $dIP_aKQ of _ [Occ=Dead] { __DEFAULT -> True }) main :: IO () [LclIdX, Str=DmdType] main = runMainIO @ () main $trModule :: Module [LclIdX[ReflectionId], Str=DmdType] $trModule = Module (TrNameS "main"#) (TrNameS "Main"#) *** End of Offense *** }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11414#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11414: Panic with -XStrict: StgCmmEnv: variable not found -------------------------------------+------------------------------------- Reporter: thomie | Owner: Type: bug | Status: new Priority: highest | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Resolution: | Keywords: Strict Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: T11414 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by osa1): I fixed this, submitting a patch in a minute. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11414#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11414: Panic with -XStrict: StgCmmEnv: variable not found -------------------------------------+------------------------------------- Reporter: thomie | Owner: Type: bug | Status: patch Priority: highest | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Resolution: | Keywords: Strict Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: T11414 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1791 Wiki Page: | -------------------------------------+------------------------------------- Changes (by osa1): * status: new => patch * differential: => Phab:D1791 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11414#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11414: Panic with -XStrict: StgCmmEnv: variable not found
-------------------------------------+-------------------------------------
Reporter: thomie | Owner:
Type: bug | Status: patch
Priority: highest | Milestone: 8.0.1
Component: Compiler | Version: 7.11
Resolution: | Keywords: Strict
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case: T11414
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D1791
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#11414: Panic with -XStrict: StgCmmEnv: variable not found -------------------------------------+------------------------------------- Reporter: thomie | Owner: Type: bug | Status: patch Priority: highest | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Resolution: | Keywords: Strict Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: T11414 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1791 Wiki Page: | -------------------------------------+------------------------------------- Comment (by osa1): So my previous attempt has failed, but, I added some inline comment in the Phabricator ticket to show how it's going wrong, so hopefully that'll help. I'll work on this later today but if someone has a fix please go ahead. (or I can do it if you just write the idea) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11414#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11414: Panic with -XStrict: StgCmmEnv: variable not found -------------------------------------+------------------------------------- Reporter: thomie | Owner: Type: bug | Status: patch Priority: highest | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Resolution: | Keywords: Strict Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: T11414 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1791 Wiki Page: | -------------------------------------+------------------------------------- Comment (by osa1): I think @goldfire might have solved it. I updated the patch and am currently waiting for validate. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11414#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11414: Panic with -XStrict: StgCmmEnv: variable not found -------------------------------------+------------------------------------- Reporter: thomie | Owner: Type: bug | Status: new Priority: highest | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Resolution: | Keywords: Strict Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: T11414 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1791 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => new Comment: Taking out of patch status as we don't yet have a convincing fix. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11414#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11414: Panic with -XStrict: StgCmmEnv: variable not found -------------------------------------+------------------------------------- Reporter: thomie | Owner: Type: bug | Status: new Priority: highest | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Resolution: | Keywords: Strict Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: T11414 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1791 Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): I need to look at this; sorry. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11414#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11414: Panic with -XStrict: StgCmmEnv: variable not found
-------------------------------------+-------------------------------------
Reporter: thomie | Owner:
Type: bug | Status: new
Priority: highest | Milestone: 8.0.1
Component: Compiler | Version: 7.11
Resolution: | Keywords: Strict
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case: T11414
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D1791
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Simon Peyton Jones

#11414: Panic with -XStrict: StgCmmEnv: variable not found -------------------------------------+------------------------------------- Reporter: thomie | Owner: Type: bug | Status: merge Priority: highest | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Resolution: | Keywords: Strict Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: T11414 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1791 Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonpj): * status: new => merge Comment: Worth merging this. I'm very happy with it. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11414#comment:13 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11414: Panic with -XStrict: StgCmmEnv: variable not found -------------------------------------+------------------------------------- Reporter: thomie | Owner: Type: bug | Status: closed Priority: highest | Milestone: 8.0.1 Component: Compiler | Version: 7.11 Resolution: fixed | Keywords: Strict Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: T11414 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1791 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed Comment: Merged as 9cc99477f2314203ab5abf2dab62c44cb2b0951f. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11414#comment:14 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC