Merge pull request #11917 from JosephTremoulet/RationalCall
authorJoseph Tremoulet <JCTremoulet@gmail.com>
Fri, 26 May 2017 05:41:38 +0000 (01:41 -0400)
committerGitHub <noreply@github.com>
Fri, 26 May 2017 05:41:38 +0000 (01:41 -0400)
Clear GTF_CALL from non-calls in rationalize

src/jit/rationalize.cpp

index adf01f9..e8bc95c 100644 (file)
@@ -970,10 +970,19 @@ Compiler::fgWalkResult Rationalizer::RewriteNode(GenTree** useEdge, ArrayStack<G
             node->gtFlags &= ~GTF_ALL_EFFECT;
         }
     }
-    else if (!node->OperIsStore())
+    else
     {
-        // Clear the GTF_ASG flag for all nodes but stores
-        node->gtFlags &= ~GTF_ASG;
+        if (!node->OperIsStore())
+        {
+            // Clear the GTF_ASG flag for all nodes but stores
+            node->gtFlags &= ~GTF_ASG;
+        }
+
+        if (!node->IsCall())
+        {
+            // Clear the GTF_CALL flag for all nodes but calls
+            node->gtFlags &= ~GTF_CALL;
+        }
     }
 
     assert(isLateArg == ((use.Def()->gtFlags & GTF_LATE_ARG) != 0));