aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@gcc.gnu.org>2019-06-28 14:53:51 +0000
committerAldy Hernandez <aldyh@gcc.gnu.org>2019-06-28 14:53:51 +0000
commit80a42f11c9502b8ef891ad8ec816e02f938b4ed7 (patch)
tree7ade91d14ea4ddeaf1634b787b9cda1884f68acf /gcc
parent543e733fc85824caee7af9e86606f2113df76fdd (diff)
downloadgcc-80a42f11c9502b8ef891ad8ec816e02f938b4ed7.zip
gcc-80a42f11c9502b8ef891ad8ec816e02f938b4ed7.tar.gz
gcc-80a42f11c9502b8ef891ad8ec816e02f938b4ed7.tar.bz2
Tweak assert_compare_value_ranges so it will work on trunk...
Tweak assert_compare_value_ranges so it will work on trunk, which doesn't have our range_misc changes that degrade all symbolics before hand. From-SVN: r272786
Diffstat (limited to 'gcc')
-rw-r--r--gcc/tree-vrp.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index 2aee500..04d3b82 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -2369,7 +2369,8 @@ assert_compare_value_ranges (const value_range_base *old_vr,
/* Sigh. extract_range_from_binary_expr may refuse to work on
varying ranges for some codes, but range-ops can sometimes derive
- useful information. */
+ useful information. This is the same check we have in
+ extract_range_from_binary_expr. */
if (code != BIT_AND_EXPR
&& code != BIT_IOR_EXPR
&& code != TRUNC_DIV_EXPR
@@ -2384,9 +2385,15 @@ assert_compare_value_ranges (const value_range_base *old_vr,
&& code != MINUS_EXPR
&& code != RSHIFT_EXPR
&& code != POINTER_PLUS_EXPR
- && (vr0->varying_p () || vr1->varying_p ())
- && old_vr->varying_p ())
- return;
+ && (vr0->varying_p ()
+ || vr1->varying_p ()
+ || vr0->symbolic_p ()
+ || vr1->symbolic_p ()))
+ {
+ /* If VRP was varying, we know we did better. */
+ if (old_vr->varying_p ())
+ return;
+ }
/* There's an unaccounted difference. This may be a real bug. */