Copy GTF_ALL_EFFECTS to hiResult in decomp
authorMichelle McDaniel <adiaaida@gmail.com>
Thu, 29 Sep 2016 17:02:31 +0000 (10:02 -0700)
committerMichelle McDaniel <adiaaida@gmail.com>
Fri, 30 Sep 2016 16:52:28 +0000 (09:52 -0700)
We need to make sure that the hiResult in decompose gets the same effect
flags as the original tree. This change updates decompose methods to pass
those flags from the tree to the hiResult in the cases that they weren't
being passed before.

src/jit/decomposelongs.cpp

index 2f0dfbe..5fb7a19 100644 (file)
@@ -819,6 +819,7 @@ GenTree* DecomposeLongs::DecomposeInd(LIR::Use& use)
     GenTreePtr addrHigh =
         new (m_compiler, GT_LEA) GenTreeAddrMode(TYP_REF, addrBaseHigh, nullptr, 0, genTypeSize(TYP_INT));
     GenTreePtr indHigh = new (m_compiler, GT_IND) GenTreeIndir(GT_IND, TYP_INT, addrHigh, nullptr);
+    indHigh->gtFlags |= (indLow->gtFlags & (GTF_GLOB_REF | GTF_EXCEPT | GTF_IND_FLAGS));
 
     m_compiler->lvaIncRefCnts(addrBaseHigh);
 
@@ -1309,6 +1310,7 @@ GenTree* DecomposeLongs::DecomposeShift(LIR::Use& use)
         GenTreeArgList* argList = m_compiler->gtNewArgList(loOp1, hiOp1, shiftByOp);
 
         GenTree* call = m_compiler->gtNewHelperCallNode(helper, TYP_LONG, 0, argList);
+        call->gtFlags |= tree->gtFlags & GTF_ALL_EFFECT;
 
         GenTreeCall*    callNode    = call->AsCall();
         ReturnTypeDesc* retTypeDesc = callNode->GetReturnTypeDesc();