aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-loop-niter.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2017-12-12 08:50:31 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2017-12-12 08:50:31 +0000
commit5b0c69ae65b713ab68202af20dae9dca533d39cf (patch)
tree3bb310f9df1511ec6309b70eb110224f29320ea1 /gcc/tree-ssa-loop-niter.c
parente157d4567738df5cb009a3304ca910501d77585f (diff)
downloadgcc-5b0c69ae65b713ab68202af20dae9dca533d39cf.zip
gcc-5b0c69ae65b713ab68202af20dae9dca533d39cf.tar.gz
gcc-5b0c69ae65b713ab68202af20dae9dca533d39cf.tar.bz2
re PR middle-end/81889 (bogus warnings with -Wmaybe-uninitialized -O3)
2017-12-12 Richard Biener <rguenther@suse.de> PR tree-optimization/81889 * tree-ssa-loop-niter.c (infer_loop_bounds_from_signedness): Use range info from the non-wrapping IV instead of just the range of the type. * gfortran.dg/pr81889.f90: New testcase. * gcc.dg/tree-ssa/pr64183.c: Adjust. From-SVN: r255573
Diffstat (limited to 'gcc/tree-ssa-loop-niter.c')
-rw-r--r--gcc/tree-ssa-loop-niter.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c
index b97f1db..b067a0d 100644
--- a/gcc/tree-ssa-loop-niter.c
+++ b/gcc/tree-ssa-loop-niter.c
@@ -3510,6 +3510,12 @@ infer_loop_bounds_from_signedness (struct loop *loop, gimple *stmt)
low = lower_bound_in_type (type, type);
high = upper_bound_in_type (type, type);
+ wide_int minv, maxv;
+ if (get_range_info (def, &minv, &maxv) == VR_RANGE)
+ {
+ low = wide_int_to_tree (type, minv);
+ high = wide_int_to_tree (type, maxv);
+ }
record_nonwrapping_iv (loop, base, step, stmt, low, high, false, true);
}