[GHC] #14264: unregisterised GHC fails buid as: ghc-stage1: panic! (the 'impossible' happened): pprCLbl AsmTempLabel

#14264: unregisterised GHC fails buid as: ghc-stage1: panic! (the 'impossible' happened): pprCLbl AsmTempLabel -------------------------------------+------------------------------------- Reporter: slyfox | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.3 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: -------------------------------------+------------------------------------- How to repdoruce on amd64: {{{ $ ./configure --enable-unregisterised $ make }}} Build failure: {{{ rts_dist_HC rts/dist/build/PrimOps.o ghc-stage1: panic! (the 'impossible' happened) (GHC version 8.3.20170920 for x86_64-unknown-linux): ghc-stage1: panic! (the 'impossible' happened) (GHC version 8.3.20170920 for x86_64-unknown-linux): ghc-stage1: panic! (the 'impossible' happened) (GHC version 8.3.20170920 for x86_64-unknown-linux): pprCLbl AsmTempLabel }}} Normally UNREG backend has no asm labels. changeset:8b007abbeb3045900a11529d907a835080129176 looks vaguely relevant as it adds AsmTempLabel in one place. But I did not look in detail yet. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14264 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14264: unregisterised GHC fails buid as: ghc-stage1: panic! (the 'impossible' happened): pprCLbl AsmTempLabel -------------------------------------+------------------------------------- Reporter: slyfox | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.3 Resolution: | Keywords: 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 slyfox): This tiny change (reverts only change from changeset:8b007abbeb3045900a11529d907a835080129176) seems to restore the build: {{{#!diff --- a/compiler/cmm/BlockId.hs +++ b/compiler/cmm/BlockId.hs @@ -42,3 +42,3 @@ newBlockId = mkBlockId <$> getUniqueM blockLbl :: BlockId -> CLabel -blockLbl label = mkAsmTempLabel (getUnique label) +blockLbl label = mkEntryLabel (mkFCallName (getUnique label) "block") NoCafRefs }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14264#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14264: unregisterised GHC fails buid as: ghc-stage1: panic! (the 'impossible' happened): pprCLbl AsmTempLabel -------------------------------------+------------------------------------- Reporter: slyfox | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.3 Resolution: | Keywords: 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 angerman): While trying to build the iOS Cross Compiler, I've run into: ``` pprCLbl (AsmTempLabel {}) = panic "pprCLbl AsmTempLabel"` ``` Looks like the minor LLVM fix D4006, is not sufficient to resolve this either. In general it seems that the `AsmTempLabel` is tied rather directly to the NCG. And quite a few functions are partial/panicking for `AsmTempLabel` outside of the NCG :( -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14264#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14264: unregisterised GHC fails buid as: ghc-stage1: panic! (the 'impossible'
happened): pprCLbl AsmTempLabel
-------------------------------------+-------------------------------------
Reporter: slyfox | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.3
Resolution: | Keywords:
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 Moritz Angermann

#14264: unregisterised GHC fails buid as: ghc-stage1: panic! (the 'impossible' happened): pprCLbl AsmTempLabel -------------------------------------+------------------------------------- Reporter: slyfox | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.3 Resolution: | Keywords: 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 slyfox): Unfortunately it was not enough for UNREG build. Still fails but now generated code is invalid: {{{ /tmp/ghc31859_0/ghc_4.hc:352:5: error: error: 'c2l_entry' used but never defined [-Werror] IF_(c2l_entry); ^ | }}} Generated code: {{{ FN_(stg_catch_entry) { W_ _c2g; _c2h: _c2g = R1.w; R1.w = *((P_)(_c2g+8)); Sp[-1] = *((P_)(_c2g+16)); Sp=Sp-1; JMP_((W_)&stg_catchzh); } const StgWord stg_catch_info[]__attribute__((aligned(8)))= { (W_)&stg_catch_entry, 0x2UL, 0x8UL }; IF_(c2l_entry); FN_(stg_catchzh) { _c2p: Sp[-1] = R1.w; Sp=Sp-2; JMP_((W_)&c2l_entry); } }}} It should have been '''stg_catch_entry''' instead of '''c2l_entry'''. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14264#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14264: unregisterised GHC fails buid as: ghc-stage1: panic! (the 'impossible'
happened): pprCLbl AsmTempLabel
-------------------------------------+-------------------------------------
Reporter: slyfox | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.3
Resolution: | Keywords:
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 Sergei Trofimovich
participants (1)
-
GHC