summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPat Gavlin <pgavlin@gmail.com>2016-09-08 08:20:47 -0700
committerGitHub <noreply@github.com>2016-09-08 08:20:47 -0700
commitc880f864bb91bddd83d5390a85a33c34eee04183 (patch)
tree972ed8021bc2e73a232ae293d8c8e78cd8c04ded
parent83629bab155c313e2cf91045be69d3b980f74f23 (diff)
parent1efc57d9c1a02f591cd37167c603b646a39566b9 (diff)
downloadcoreclr-c880f864bb91bddd83d5390a85a33c34eee04183.tar.gz
coreclr-c880f864bb91bddd83d5390a85a33c34eee04183.tar.bz2
coreclr-c880f864bb91bddd83d5390a85a33c34eee04183.zip
Merge pull request #7011 from svick/earlyprop-unused-var
Fix BBF_HAS_NULLCHECK test
-rw-r--r--src/jit/earlyprop.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/jit/earlyprop.cpp b/src/jit/earlyprop.cpp
index 70d1012aa0..5b985df2bb 100644
--- a/src/jit/earlyprop.cpp
+++ b/src/jit/earlyprop.cpp
@@ -190,7 +190,6 @@ void Compiler::optEarlyProp()
// Walk the stmt tree in linear order to rewrite any array length reference with a
// constant array length.
bool isRewritten = false;
- bool bbHasNullCheck = (block->bbFlags & BBF_HAS_NULLCHECK) != 0;
for (GenTreePtr tree = stmt->gtStmt.gtStmtList; tree != nullptr; tree = tree->gtNext)
{
if (optEarlyPropRewriteTree(tree))
@@ -511,6 +510,11 @@ void Compiler::optFoldNullCheck(GenTreePtr tree)
// |
// x
+ if ((compCurBB->bbFlags & BBF_HAS_NULLCHECK) == 0)
+ {
+ return;
+ }
+
assert(tree->OperGet() == GT_IND);
if (tree->gtGetOp1()->OperGet() == GT_LCL_VAR)
{