[commit: ghc] master: don't allow AsmTempLabel in UNREG mode (Trac #14264) (b3ae47c)

git at git.haskell.org git at git.haskell.org
Sun Sep 24 12:29:20 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/b3ae47caf2f23cfd2c22c29dbfca646493ffe469/ghc

>---------------------------------------------------------------

commit b3ae47caf2f23cfd2c22c29dbfca646493ffe469
Author: Sergei Trofimovich <slyfox at gentoo.org>
Date:   Sun Sep 24 12:14:03 2017 +0100

    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 at gentoo.org>


>---------------------------------------------------------------

b3ae47caf2f23cfd2c22c29dbfca646493ffe469
 compiler/cmm/CLabel.hs | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/compiler/cmm/CLabel.hs b/compiler/cmm/CLabel.hs
index 54395b6..9c664c2 100644
--- a/compiler/cmm/CLabel.hs
+++ b/compiler/cmm/CLabel.hs
@@ -197,6 +197,7 @@ data CLabel
         {-# UNPACK #-} !Unique  -- Unique says which case expression
         CaseLabelInfo
 
+  -- | Local temporary label used for native (or LLVM) code generation
   | AsmTempLabel
         {-# UNPACK #-} !Unique
 
@@ -1092,6 +1093,7 @@ instance Outputable CLabel where
 pprCLabel :: Platform -> CLabel -> SDoc
 
 pprCLabel platform (AsmTempLabel u)
+ | not (platformUnregisterised platform)
   =  getPprStyle $ \ sty ->
      if asmStyle sty then
         ptext (asmTempLabelPrefix platform) <> pprUniqueAlways u



More information about the ghc-commits mailing list