[commit: ghc] wip/T14626: WIP: actuall look at the type of the constr field (c0347ca)

git at git.haskell.org git at git.haskell.org
Sat Jan 13 22:48:48 UTC 2018


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

On branch  : wip/T14626
Link       : http://ghc.haskell.org/trac/ghc/changeset/c0347ca0b02be0a7faaeb9ef0c15292268025483/ghc

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

commit c0347ca0b02be0a7faaeb9ef0c15292268025483
Author: Gabor Greif <ggreif at gmail.com>
Date:   Sat Jan 13 23:47:37 2018 +0100

    WIP: actuall look at the type of the constr field


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

c0347ca0b02be0a7faaeb9ef0c15292268025483
 compiler/codeGen/StgCmmCon.hs | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/compiler/codeGen/StgCmmCon.hs b/compiler/codeGen/StgCmmCon.hs
index fe85f05..a00081c 100644
--- a/compiler/codeGen/StgCmmCon.hs
+++ b/compiler/codeGen/StgCmmCon.hs
@@ -30,7 +30,8 @@ import StgCmmUtils
 import StgCmmClosure
 import StgCmmProf ( curCCS )
 
-import TyCon
+import TyCon -- NOT NEEDED
+import Type (isAlgType)
 import CmmExpr
 import CLabel
 import MkGraph
@@ -255,13 +256,15 @@ buildDynCon' dflags _ binder actually_bound ccs con args
 
       blame_cc = use_cc -- cost-centre on which to blame the alloc (same)
 
-      checkTagOnPtr base ((_,offset), bang) | isBanged bang = do
-                lgood <- newBlockId
+      checkTagOnPtr base (((NonVoid (StgVarArg var)),offset), bang)
+          | isBanged bang
+          , isAlgType (let ty = idType var in pprTrace "checkTagOnPtrTy" (ppr ty) ty)
+           = do lgood <- newBlockId
                 lcall <- newBlockId
                 let p = CmmLoad (cmmOffsetB dflags base offset) (bWord dflags)
                 emit $ mkCbranch (cmmIsTagged dflags p)
                          lgood lcall Nothing
-                emitLabel lcall
+                pprTrace "checkTagOnPtr" (ppr con $$ ppr (dataConRepType con)) emitLabel lcall
                 emitRtsCall rtsUnitId
                   (fsLit "checkTagged") [(p, AddrHint)] False
                 emitLabel lgood



More information about the ghc-commits mailing list