diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-07-26 10:25:15 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-07-26 10:25:15 +0000 |
commit | bcaf4fd0010426660a9257af2bc69d49a3c704ca (patch) | |
tree | b03aa96ec8b0cf57027f4f83da003d90bc8152c2 /gcc/tree-vrp.c | |
parent | c35d742c78070ed908ee7cb07fc356f04622fe52 (diff) | |
download | gcc-bcaf4fd0010426660a9257af2bc69d49a3c704ca.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@189885 138bc75d-0d04-0410-961f-82ee72b054a4
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 2d1628dee3d..1a4c7c9f3af 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); |