diff options
author | Aart Bik <ajcbik@google.com> | 2017-04-14 12:00:15 -0700 |
---|---|---|
committer | Aart Bik <ajcbik@google.com> | 2017-04-14 12:00:15 -0700 |
commit | d86c08555905dbc42233a506683e3995446fc113 (patch) | |
tree | 1cc9187dbbcd9b8082b1ffc8a063094303945321 /compiler/optimizing/loop_optimization.cc | |
parent | 66e226ac2fb525c7a7cbbb21a9cbbe347f531a1c (diff) |
Fixed bug on pending environment use of termination condition.
With regression test.
Test: test-art-host
Bug: 37247891
Change-Id: I55b06939d465d3ddb736d1ba659b1df179a5c390
Diffstat (limited to 'compiler/optimizing/loop_optimization.cc')
-rw-r--r-- | compiler/optimizing/loop_optimization.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/optimizing/loop_optimization.cc b/compiler/optimizing/loop_optimization.cc index cf7acb36d1..da57550f56 100644 --- a/compiler/optimizing/loop_optimization.cc +++ b/compiler/optimizing/loop_optimization.cc @@ -1078,7 +1078,10 @@ bool HLoopOptimization::TrySetSimpleLoopHeader(HBasicBlock* block) { HInstruction* s = block->GetFirstInstruction(); if (s != nullptr && s->IsSuspendCheck()) { HInstruction* c = s->GetNext(); - if (c != nullptr && c->IsCondition() && c->GetUses().HasExactlyOneElement()) { + if (c != nullptr && + c->IsCondition() && + c->GetUses().HasExactlyOneElement() && // only used for termination + !c->HasEnvironmentUses()) { // unlikely, but not impossible HInstruction* i = c->GetNext(); if (i != nullptr && i->IsIf() && i->InputAt(0) == c) { iset_->insert(c); |