aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vrp.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2014-05-28 11:07:06 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2014-05-28 11:07:06 +0000
commita896172d192d4b2ba73877ba164688dcbdb546c9 (patch)
treea2ecd1fe3a8d5801ba51362b7fa18e7b20aea833 /gcc/tree-vrp.c
parent49664873f8397f8ebd0aa14b57497974e703651a (diff)
downloadgcc-a896172d192d4b2ba73877ba164688dcbdb546c9.zip
gcc-a896172d192d4b2ba73877ba164688dcbdb546c9.tar.gz
gcc-a896172d192d4b2ba73877ba164688dcbdb546c9.tar.bz2
re PR tree-optimization/61335 (wrong code with -O2 -fbounds-check)
2014-05-28 Richard Biener <rguenther@suse.de> PR tree-optimization/61335 * tree-vrp.c (vrp_visit_phi_node): If the compare of old and new range fails, drop to varying. * gfortran.dg/pr61335.f90: New testcase. From-SVN: r211012
Diffstat (limited to 'gcc/tree-vrp.c')
-rw-r--r--gcc/tree-vrp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index afabc4c..67c70cb 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -8323,8 +8323,14 @@ vrp_visit_phi_node (gimple phi)
&& edges == old_edges
&& lhs_vr->type != VR_UNDEFINED)
{
+ /* Compare old and new ranges, fall back to varying if the
+ values are not comparable. */
int cmp_min = compare_values (lhs_vr->min, vr_result.min);
+ if (cmp_min == -2)
+ goto varying;
int cmp_max = compare_values (lhs_vr->max, vr_result.max);
+ if (cmp_max == -2)
+ goto varying;
/* For non VR_RANGE or for pointers fall back to varying if
the range changed. */