re PR tree-optimization/77444 (Bogus assignments in cand_value_at)
authorJakub Jelinek <jakub@redhat.com>
Fri, 2 Sep 2016 17:12:27 +0000 (19:12 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 2 Sep 2016 17:12:27 +0000 (19:12 +0200)
PR tree-optimization/77444
* tree-ssa-loop-ivopts.c (cand_value_at): For pointers use sizetype
as steptype, remove redundant initialization.

Co-Authored-By: Richard Biener <rguenther@suse.de>
From-SVN: r239962

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

index c57c89ef80d111f635ca06dfe99fe56d34e88549..bea6050c94a6c726d96741cca18d1344ef204a4f 100644 (file)
@@ -1,3 +1,10 @@
+2016-09-02  Jakub Jelinek  <jakub@redhat.com>
+           Richard Biener  <rguenth@suse.de>
+
+       PR tree-optimization/77444
+       * tree-ssa-loop-ivopts.c (cand_value_at): For pointers use sizetype
+       as steptype, remove redundant initialization.
+
 2016-09-02  Jakub Jelinek  <jakub@redhat.com>
 
        PR sanitizer/77396
index 62ba71bd18a398e7bc449c51d6243aa218007e9a..6886790a4c5b86b00f3205863f434c5b048dc8df 100644 (file)
@@ -5168,10 +5168,11 @@ cand_value_at (struct loop *loop, struct iv_cand *cand, gimple *at, tree niter,
   aff_tree step, delta, nit;
   struct iv *iv = cand->iv;
   tree type = TREE_TYPE (iv->base);
-  tree steptype = type;
+  tree steptype;
   if (POINTER_TYPE_P (type))
     steptype = sizetype;
-  steptype = unsigned_type_for (type);
+  else
+    steptype = unsigned_type_for (type);
 
   tree_to_aff_combination (iv->step, TREE_TYPE (iv->step), &step);
   aff_combination_convert (&step, steptype);