diff options
author | Richard Guenther <rguenther@suse.de> | 2012-07-26 10:25:15 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2012-07-26 10:25:15 +0000 |
commit | 2f33158ffbcca343ca00c302935f2d324b47d373 (patch) | |
tree | b03aa96ec8b0cf57027f4f83da003d90bc8152c2 /gcc/tree-vrp.c | |
parent | da7d74c253ffa8e7849c9186ef62234a02bc6855 (diff) | |
download | gcc-2f33158ffbcca343ca00c302935f2d324b47d373.zip gcc-2f33158ffbcca343ca00c302935f2d324b47d373.tar.gz gcc-2f33158ffbcca343ca00c302935f2d324b47d373.tar.bz2 |
re PR tree-optimization/54098 (ICE on valid code)
2012-07-26 Richard Guenther <rguenther@suse.de>
PR tree-optimization/54098
* tree-vrp.c (vrp_visit_phi_node): Iterate once more if the
original range was UNDEFINED.
* gcc.dg/torture/pr54098.c: New testcase.
From-SVN: r189885
Diffstat (limited to 'gcc/tree-vrp.c')
-rw-r--r-- | gcc/tree-vrp.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index 2d1628d..1a4c7c9f 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -7684,10 +7684,12 @@ vrp_visit_phi_node (gimple phi) when the new value is slightly bigger or smaller than the previous one. We don't do this if we have seen a new executable edge; this helps us avoid an overflow infinity for conditionals - which are not in a loop. */ + which are not in a loop. If the old value-range was VR_UNDEFINED + use the updated range and iterate one more time. */ if (edges > 0 && gimple_phi_num_args (phi) > 1 - && edges == old_edges) + && edges == old_edges + && lhs_vr->type != VR_UNDEFINED) { int cmp_min = compare_values (lhs_vr->min, vr_result.min); int cmp_max = compare_values (lhs_vr->max, vr_result.max); |