tree-ssa-loop-niter.c (infer_loop_bounds_from_pointer_arith): Properly call analyze_s...
authorRichard Biener <rguenther@suse.de>
Wed, 11 Oct 2017 13:20:59 +0000 (13:20 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 11 Oct 2017 13:20:59 +0000 (13:20 +0000)
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

gcc/ChangeLog
gcc/tree-ssa-loop-niter.c

index 91e16cf61e172a7ac5aca3208141eb51ab544e4d..e5745b466bde2e51a3da8b5243a21552d52d9697 100644 (file)
@@ -1,3 +1,8 @@
+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.
index f8f2eeb1a3b81b86f12cfefefcf3eec54f60f5d0..6efe67a95315acf303e42884f558a81b52c0ed39 100644 (file)
@@ -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;