From a896172d192d4b2ba73877ba164688dcbdb546c9 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Wed, 28 May 2014 11:07:06 +0000 Subject: re PR tree-optimization/61335 (wrong code with -O2 -fbounds-check) 2014-05-28 Richard Biener 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 --- gcc/tree-vrp.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gcc/tree-vrp.c') 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. */ -- cgit v1.1