[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 <moritz.angermann@…>): In [changeset:"d55961262be1b6bbacea0cd6864346f8822ee99b/ghc" d5596126/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="d55961262be1b6bbacea0cd6864346f8822ee99b" Fix AsmTempLabel Summary: This is another fallout from 8b007abb should fix Trac #14264. I am not sure if this is complete. It does however allow me to build an iOS LLVM cross compiler. Reviewers: bgamari, trofi, austin, simonmar Reviewed By: trofi Subscribers: rwbarton, thomie GHC Trac Issues: #14264 Differential Revision: https://phabricator.haskell.org/D4014 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14264#comment:3> 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): 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 <slyfox@…>): In [changeset:"b3ae47caf2f23cfd2c22c29dbfca646493ffe469/ghc" b3ae47c/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="b3ae47caf2f23cfd2c22c29dbfca646493ffe469" don't allow AsmTempLabel in UNREG mode (Trac #14264) AsmTempLabel is really a label that describes label in assembly output (or equivalent like LLVM IR). Unregisterised build does not handle it correctly. This change does not fix UNREG build failure in Ticket #14264 but reverts back to panic: pprCLbl AsmTempLabel Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14264#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC