diff options
author | Ben Gamari <bgamari.foss@gmail.com> | 2017-09-19 10:58:36 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-09-19 13:37:46 -0400 |
commit | 8b007abbeb3045900a11529d907a835080129176 (patch) | |
tree | 811084db4cf156ff51cf8661631676d6fb0ff326 /compiler/nativeGen/PPC | |
parent | 6252292d4f4061f6e55c7f92a399160147c4ca74 (diff) | |
download | haskell-8b007abbeb3045900a11529d907a835080129176.tar.gz |
nativeGen: Consistently use blockLbl to generate CLabels from BlockIds
This fixes #14221, where the NCG and the DWARF code were apparently
giving two different names to the same block.
Test Plan: Validate with DWARF support enabled.
Reviewers: simonmar, austin
Subscribers: rwbarton, thomie
GHC Trac Issues: #14221
Differential Revision: https://phabricator.haskell.org/D3977
Diffstat (limited to 'compiler/nativeGen/PPC')
-rw-r--r-- | compiler/nativeGen/PPC/CodeGen.hs | 5 | ||||
-rw-r--r-- | compiler/nativeGen/PPC/Ppr.hs | 9 |
2 files changed, 7 insertions, 7 deletions
diff --git a/compiler/nativeGen/PPC/CodeGen.hs b/compiler/nativeGen/PPC/CodeGen.hs index 1a802d34b2..7b898ee6b0 100644 --- a/compiler/nativeGen/PPC/CodeGen.hs +++ b/compiler/nativeGen/PPC/CodeGen.hs @@ -52,7 +52,6 @@ import Hoopl.Graph -- The rest: import OrdList import Outputable -import Unique import DynFlags import Control.Monad ( mapAndUnzipM, when ) @@ -214,7 +213,7 @@ getRegisterReg platform (CmmGlobal mid) jumpTableEntry :: DynFlags -> Maybe BlockId -> CmmStatic jumpTableEntry dflags Nothing = CmmStaticLit (CmmInt 0 (wordWidth dflags)) jumpTableEntry _ (Just blockid) = CmmStaticLit (CmmLabel blockLabel) - where blockLabel = mkAsmTempLabel (getUnique blockid) + where blockLabel = blockLbl blockid @@ -1996,7 +1995,7 @@ generateJumpTableForInstr dflags (BCTR ids (Just lbl)) = = CmmStaticLit (CmmInt 0 (wordWidth dflags)) jumpTableEntryRel (Just blockid) = CmmStaticLit (CmmLabelDiffOff blockLabel lbl 0) - where blockLabel = mkAsmTempLabel (getUnique blockid) + where blockLabel = blockLbl blockid in Just (CmmData (Section ReadOnlyData lbl) (Statics lbl jumpTable)) generateJumpTableForInstr _ _ = Nothing diff --git a/compiler/nativeGen/PPC/Ppr.hs b/compiler/nativeGen/PPC/Ppr.hs index 63d01c3913..fe8d9e6484 100644 --- a/compiler/nativeGen/PPC/Ppr.hs +++ b/compiler/nativeGen/PPC/Ppr.hs @@ -23,9 +23,10 @@ import Cmm hiding (topInfoTable) import Hoopl.Collections import Hoopl.Label +import BlockId import CLabel -import Unique ( pprUniqueAlways, Uniquable(..) ) +import Unique ( pprUniqueAlways ) import Platform import FastString import Outputable @@ -108,7 +109,7 @@ pprFunctionPrologue lab = pprGloblDecl lab pprBasicBlock :: LabelMap CmmStatics -> NatBasicBlock Instr -> SDoc pprBasicBlock info_env (BasicBlock blockid instrs) = maybe_infotable $$ - pprLabel (mkAsmTempLabel (getUnique blockid)) $$ + pprLabel (blockLbl blockid) $$ vcat (map pprInstr instrs) where maybe_infotable = case mapLookup blockid info_env of @@ -576,7 +577,7 @@ pprInstr (BCC cond blockid) = hcat [ char '\t', ppr lbl ] - where lbl = mkAsmTempLabel (getUnique blockid) + where lbl = blockLbl blockid pprInstr (BCCFAR cond blockid) = vcat [ hcat [ @@ -589,7 +590,7 @@ pprInstr (BCCFAR cond blockid) = vcat [ ppr lbl ] ] - where lbl = mkAsmTempLabel (getUnique blockid) + where lbl = blockLbl blockid pprInstr (JMP lbl) -- We never jump to ForeignLabels; if we ever do, c.f. handling for "BL" |