From: Jakub Jelinek Date: Fri, 2 Sep 2016 17:12:27 +0000 (+0200) Subject: re PR tree-optimization/77444 (Bogus assignments in cand_value_at) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bad9b2889af54110857416e4f9e65f4032f2f5f4;p=gcc.git re PR tree-optimization/77444 (Bogus assignments in cand_value_at) 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 From-SVN: r239962 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c57c89ef80d..bea6050c94a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2016-09-02 Jakub Jelinek + Richard Biener + + 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 PR sanitizer/77396 diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c index 62ba71bd18a..6886790a4c5 100644 --- a/gcc/tree-ssa-loop-ivopts.c +++ b/gcc/tree-ssa-loop-ivopts.c @@ -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);