summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2017-10-11 13:20:59 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2017-10-11 13:20:59 +0000
commit85866209d4b1819c1a99071c980a42f4db35d104 (patch)
treef4a257457e87228ee93de4d188b067d019ac9b9f
parentd2ec027749d7fcce502b2edf6667999efb4e05e6 (diff)
tree-ssa-loop-niter.c (infer_loop_bounds_from_pointer_arith): Properly call analyze_scalar_evolution with the loop of the stmt.
2017-10-11 Richard Biener <rguenther@suse.de> * tree-ssa-loop-niter.c (infer_loop_bounds_from_pointer_arith): Properly call analyze_scalar_evolution with the loop of the stmt. From-SVN: r253644
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/tree-ssa-loop-niter.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 91e16cf61e1..e5745b466bd 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2017-10-11 Richard Biener <rguenther@suse.de>
+ * tree-ssa-loop-niter.c (infer_loop_bounds_from_pointer_arith):
+ Properly call analyze_scalar_evolution with the loop of the stmt.
+
+2017-10-11 Richard Biener <rguenther@suse.de>
+
* tree.def (POLYNOMIAL_CHREC): Remove CHREC_VARIABLE tree operand.
* tree-core.h (tree_base): Add chrec_var union member.
* tree.h (CHREC_VAR): Remove.
diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c
index f8f2eeb1a3b..6efe67a9531 100644
--- a/gcc/tree-ssa-loop-niter.c
+++ b/gcc/tree-ssa-loop-niter.c
@@ -3444,7 +3444,8 @@ infer_loop_bounds_from_pointer_arith (struct loop *loop, gimple *stmt)
if (TYPE_PRECISION (type) != TYPE_PRECISION (TREE_TYPE (var)))
return;
- scev = instantiate_parameters (loop, analyze_scalar_evolution (loop, def));
+ struct loop *uloop = loop_containing_stmt (stmt);
+ scev = instantiate_parameters (loop, analyze_scalar_evolution (uloop, def));
if (chrec_contains_undetermined (scev))
return;