diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2015-06-22 09:16:04 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-06-22 09:16:05 +0000 |
commit | c9345cc258d6a4e164b7e64ee1e67e69a180b972 (patch) | |
tree | 3d05ef937788d5088c1f0acc6e89a6a28fe5524a /compiler | |
parent | 25fde612b0df01a086cd4c801b7bd3a10e93a0e9 (diff) | |
parent | 7d4cc8c786ff4a19234c1b034eae61ac0f3a37da (diff) | |
download | art-c9345cc258d6a4e164b7e64ee1e67e69a180b972.zip art-c9345cc258d6a4e164b7e64ee1e67e69a180b972.tar.gz art-c9345cc258d6a4e164b7e64ee1e67e69a180b972.tar.bz2 |
Merge "Fix wrong DCHECK in bounds check elimination." into mnc-dev
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/optimizing/bounds_check_elimination.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/optimizing/bounds_check_elimination.cc b/compiler/optimizing/bounds_check_elimination.cc index 97b3725..900dabe 100644 --- a/compiler/optimizing/bounds_check_elimination.cc +++ b/compiler/optimizing/bounds_check_elimination.cc @@ -1759,7 +1759,9 @@ class BCEVisitor : public HGraphVisitor { ValueBound lower_bound = range->GetLower(); DCHECK(lower_bound.IsConstant()); DCHECK(const_instr->GetValue() <= kMaxConstantForAddingDeoptimize); - DCHECK_EQ(lower_bound.GetConstant(), const_instr->GetValue() + 1); + // Note that the lower bound of the array length may have been refined + // through other instructions (such as `HNewArray(length - 4)`). + DCHECK_LE(const_instr->GetValue() + 1, lower_bound.GetConstant()); // If array_length is less than lower_const, deoptimize. HBoundsCheck* bounds_check = first_constant_index_bounds_check_map_.Get( |