aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2014-05-27 10:32:39 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2014-05-27 10:32:39 +0000
commit597f59975ce15635260a58533e436748c9600c36 (patch)
treee7fb17fdb9538ab422c7ba07cff95d68bfd051d0
parentf571b63f52480bcdd80abbd314810130960ed3b8 (diff)
downloadgcc-597f59975ce15635260a58533e436748c9600c36.zip
gcc-597f59975ce15635260a58533e436748c9600c36.tar.gz
gcc-597f59975ce15635260a58533e436748c9600c36.tar.bz2
tree-vrp.c (vrp_evaluate_conditional_warnv_with_ops_using_ranges): Try using literal operands when comparing value-ranges failed.
2014-05-27 Richard Biener <rguenther@suse.de> * tree-vrp.c (vrp_evaluate_conditional_warnv_with_ops_using_ranges): Try using literal operands when comparing value-ranges failed. From-SVN: r210966
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/tree-vrp.c13
2 files changed, 12 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8e58817..d336d13 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2014-05-27 Richard Biener <rguenther@suse.de>
+
+ * tree-vrp.c (vrp_evaluate_conditional_warnv_with_ops_using_ranges):
+ Try using literal operands when comparing value-ranges failed.
+
2014-05-27 Richard Sandiford <rdsandiford@googlemail.com>
* ira.c (commutative_operand): Adjust for change to recog_data.
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index 7f0489f..afabc4c 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -6919,14 +6919,15 @@ vrp_evaluate_conditional_warnv_with_ops_using_ranges (enum tree_code code,
vr0 = (TREE_CODE (op0) == SSA_NAME) ? get_value_range (op0) : NULL;
vr1 = (TREE_CODE (op1) == SSA_NAME) ? get_value_range (op1) : NULL;
+ tree res = NULL_TREE;
if (vr0 && vr1)
- return compare_ranges (code, vr0, vr1, strict_overflow_p);
- else if (vr0 && vr1 == NULL)
- return compare_range_with_value (code, vr0, op1, strict_overflow_p);
- else if (vr0 == NULL && vr1)
- return (compare_range_with_value
+ res = compare_ranges (code, vr0, vr1, strict_overflow_p);
+ if (!res && vr0)
+ res = compare_range_with_value (code, vr0, op1, strict_overflow_p);
+ if (!res && vr1)
+ res = (compare_range_with_value
(swap_tree_comparison (code), vr1, op0, strict_overflow_p));
- return NULL;
+ return res;
}
/* Helper function for vrp_evaluate_conditional_warnv. */