[commit: ghc] wip/T15155: WIP: assert that other fields are zeroed out (b259ea6)

git at git.haskell.org git at git.haskell.org
Thu May 24 14:34:25 UTC 2018


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

On branch  : wip/T15155
Link       : http://ghc.haskell.org/trac/ghc/changeset/b259ea6cdcef70d62bc2bdd8298894cadfe03f59/ghc

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

commit b259ea6cdcef70d62bc2bdd8298894cadfe03f59
Author: Gabor Greif <ggreif at gmail.com>
Date:   Thu May 24 16:20:07 2018 +0200

    WIP: assert that other fields are zeroed out


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

b259ea6cdcef70d62bc2bdd8298894cadfe03f59
 compiler/nativeGen/X86/Ppr.hs | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/compiler/nativeGen/X86/Ppr.hs b/compiler/nativeGen/X86/Ppr.hs
index ea26e18..b5571bd 100644
--- a/compiler/nativeGen/X86/Ppr.hs
+++ b/compiler/nativeGen/X86/Ppr.hs
@@ -32,6 +32,7 @@ import Instruction
 import Format
 import Reg
 import PprBase
+import Util (debugIsOn)
 
 
 import Hoopl.Collections
@@ -145,7 +146,7 @@ pprBasicBlock info_env (BasicBlock blockid instrs)
 
 pprDatas :: (Alignment, CmmStatics) -> SDoc
 
-pprDatas (_, Statics alias [CmmStaticLit lit@(CmmLabel lbl), CmmStaticLit ind, _, _])
+pprDatas (_, Statics alias [CmmStaticLit lit@(CmmLabel lbl), CmmStaticLit ind, x, y])
   | lbl == mkIndStaticInfoLabel
   , let labelInd (CmmLabelOff l _) = Just l
         labelInd (CmmLabel l) = Just l
@@ -153,7 +154,8 @@ pprDatas (_, Statics alias [CmmStaticLit lit@(CmmLabel lbl), CmmStaticLit ind, _
   , Just ind' <- labelInd ind
   , not $ externallyVisibleCLabel ind' -- trips ld64 otherwise
   , let equate = pprGloblDecl alias $$ text ".equiv" <+> ppr alias <> comma <> ppr (CmmLabel ind')
-  = pprTrace "IndStaticInfo: pprDatas" (ppr alias <+> ppr lit <+> ppr ind') equate
+  = ASSERT( (case x of CmmStaticLit (CmmInt 0 _) -> True; _ -> False) && (case y of CmmStaticLit (CmmInt 0 _) -> True; _ -> False) )
+      pprTrace "IndStaticInfo: pprDatas" (ppr alias <+> ppr lit <+> ppr ind') equate
 
 pprDatas (align, (Statics lbl dats))
  = vcat (pprAlign align : pprLabel lbl : map pprData dats)



More information about the ghc-commits mailing list