summaryrefslogtreecommitdiff
path: root/compiler/dex/mir_optimization.cc
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2015-06-08 16:39:02 +0100
committer Vladimir Marko <vmarko@google.com> 2015-06-08 18:39:27 +0100
commit67c8c942e9dfcabd548351db75e6d3b8b5165afa (patch)
tree4af6e0cc9637e93cd9e3f64fc241094ce9b06657 /compiler/dex/mir_optimization.cc
parent8c4cce0abe6cfa8f4157cfa42b18474d9536c159 (diff)
Quick: Fix LoopRepeatingTopologicalSortIterator.
Always push the loop head on the loop head stack. This fixes a bug where we failed to return to an unnatural loop head to recalculate its GVN data. Bug: 17410955 Change-Id: I3a2c3225e5d16268c3f56f7f90228759c7da37a9
Diffstat (limited to 'compiler/dex/mir_optimization.cc')
-rw-r--r--compiler/dex/mir_optimization.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/dex/mir_optimization.cc b/compiler/dex/mir_optimization.cc
index 7b1ec398d0..645511ed9f 100644
--- a/compiler/dex/mir_optimization.cc
+++ b/compiler/dex/mir_optimization.cc
@@ -1790,7 +1790,8 @@ bool MIRGraph::EliminateSuspendChecks(BasicBlock* bb) {
pred_mask_union |= pred_mask;
}
}
- DCHECK_EQ(((1u << (IsLoopHead(bb->id) ? bb->nesting_depth - 1u: bb->nesting_depth)) - 1u),
+ // DCHECK_EQ() may not hold for unnatural loop heads, so use DCHECK_GE().
+ DCHECK_GE(((1u << (IsLoopHead(bb->id) ? bb->nesting_depth - 1u: bb->nesting_depth)) - 1u),
pred_mask_union);
suspend_checks_in_loops &= pred_mask_union;
}