diff options
author | Richard Guenther <rguenther@suse.de> | 2010-04-19 15:17:26 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2010-04-19 15:17:26 +0000 |
commit | 1936a7d49ca05c3569a9889d0fa477a19f86b8e1 (patch) | |
tree | 8a0d83a692e71a81304e1386f71cf1051ed660b3 /gcc/tree-vrp.c | |
parent | 479881c395c4048943b57472bdf1b56b911a8381 (diff) | |
download | gcc-1936a7d49ca05c3569a9889d0fa477a19f86b8e1.tar.gz |
re PR middle-end/43796 (ICE in is_overflow_infinity (tree-vrp.c:184) with gfortran -fcheck=bounds -O2)
2010-04-19 Richard Guenther <rguenther@suse.de>
PR tree-optimization/43796
* tree-vrp.c (adjust_range_with_scev): Lookup init and step
from SCEV in the lattice.
(vrp_visit_phi_node): Dump change.
* gfortran.dg/pr43796.f90: New testcase.
From-SVN: r158520
Diffstat (limited to 'gcc/tree-vrp.c')
-rw-r--r-- | gcc/tree-vrp.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index 3b22948e39f..b23132ca043 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -3153,7 +3153,7 @@ static void adjust_range_with_scev (value_range_t *vr, struct loop *loop, gimple stmt, tree var) { - tree init, step, chrec, tmin, tmax, min, max, type; + tree init, step, chrec, tmin, tmax, min, max, type, tem; enum ev_direction dir; /* TODO. Don't adjust anti-ranges. An anti-range may provide @@ -3174,7 +3174,13 @@ adjust_range_with_scev (value_range_t *vr, struct loop *loop, return; init = initial_condition_in_loop_num (chrec, loop->num); + tem = op_with_constant_singleton_value_range (init); + if (tem) + init = tem; step = evolution_part_in_loop_num (chrec, loop->num); + tem = op_with_constant_singleton_value_range (step); + if (tem) + step = tem; /* If STEP is symbolic, we can't know whether INIT will be the minimum or maximum value in the range. Also, unless INIT is @@ -6432,7 +6438,18 @@ vrp_visit_phi_node (gimple phi) /* If the new range is different than the previous value, keep iterating. */ if (update_value_range (lhs, &vr_result)) - return SSA_PROP_INTERESTING; + { + if (dump_file && (dump_flags & TDF_DETAILS)) + { + fprintf (dump_file, "Found new range for "); + print_generic_expr (dump_file, lhs, 0); + fprintf (dump_file, ": "); + dump_value_range (dump_file, &vr_result); + fprintf (dump_file, "\n\n"); + } + + return SSA_PROP_INTERESTING; + } /* Nothing changed, don't add outgoing edges. */ return SSA_PROP_NOT_INTERESTING; |