Optimizing: Fix a new valgrind error in image_test.
Bug: 27651442
Bug: 27151098
Change-Id: I23a428be68ccf9f9557df01ee7e920eeeb8da2ba
diff --git a/compiler/optimizing/induction_var_analysis.cc b/compiler/optimizing/induction_var_analysis.cc
index 8d24e26..266cb10 100644
--- a/compiler/optimizing/induction_var_analysis.cc
+++ b/compiler/optimizing/induction_var_analysis.cc
@@ -789,7 +789,9 @@
min++;
}
// Do both bounds fit the range?
- int64_t value;
+ // Note: The `value` is initialized to please valgrind - the compiler can reorder
+ // the return value check with the `value` check, b/27651442 .
+ int64_t value = 0;
return IsAtLeast(lower_expr, &value) && value >= min &&
IsAtMost(lower_expr, &value) && value <= max &&
IsAtLeast(upper_expr, &value) && value >= min &&