From: Michelle McDaniel Date: Tue, 25 Oct 2016 17:09:06 +0000 (-0700) Subject: Fix flag check when morphing into rotate X-Git-Tag: accepted/tizen/base/20180629.140029~3250^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=650358779c1d0f3cca92bf599aaf249773a9b554;p=platform%2Fupstream%2Fcoreclr.git Fix flag check when morphing into rotate When we morphed a tree into a rotate, we assumed that the parent's flags would be the same as its operands' flags, when in actuality, the parent's flags should be a superset of its operands' flags. This change fixes the flag check. Fixes VSO 278374. --- diff --git a/src/jit/morph.cpp b/src/jit/morph.cpp index b55c24a..ef7bd7d 100644 --- a/src/jit/morph.cpp +++ b/src/jit/morph.cpp @@ -14339,7 +14339,15 @@ GenTreePtr Compiler::fgRecognizeAndMorphBitwiseRotation(GenTreePtr tree) tree->gtOp.gtOp1 = rotatedValue; tree->gtOp.gtOp2 = rotateIndex; tree->ChangeOper(rotateOp); - noway_assert(inputTreeEffects == ((rotatedValue->gtFlags | rotateIndex->gtFlags) & GTF_ALL_EFFECT)); + + unsigned childFlags = 0; + for (GenTree* op : tree->Operands()) + { + childFlags |= (op->gtFlags & GTF_ALL_EFFECT); + } + + // The parent's flags should be a superset of its operands' flags + noway_assert((inputTreeEffects & childFlags) == childFlags); } else {