summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2007-03-05 18:01:00 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2007-03-05 18:01:00 +0000
commitc08d658d13abc2e929643a24a1cd472d701759ef (patch)
treec9f92192867005cede3b191cf655a7c041ddda8e
parentf4ecf2ee6fe566d3e95ba1b10e1ccfd9f44708d2 (diff)
downloadppe42-gcc-c08d658d13abc2e929643a24a1cd472d701759ef.tar.gz
ppe42-gcc-c08d658d13abc2e929643a24a1cd472d701759ef.zip
PR tree-optimization/31034
* tree-vrp.c (extract_range_from_assert): Don't try to handle a half-range if the other side is an overflow infinity. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122562 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/tree-vrp.c14
2 files changed, 14 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3c2a92e7d9d..a1a5e3cd41c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2007-03-05 Ian Lance Taylor <iant@google.com>
+
+ PR tree-optimization/31034
+ * tree-vrp.c (extract_range_from_assert): Don't try to handle a
+ half-range if the other side is an overflow infinity.
+
2007-03-05 Bernd Schmidt <bernd.schmidt@analog.com>
* config.gcc (bfin*-uclinux*): Use t-bfin-uclinux.
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index d3785a427e1..fd5ba643db0 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -1137,13 +1137,14 @@ extract_range_from_assert (value_range_t *vr_p, tree expr)
/* If the maximum value forces us to be out of bounds, simply punt.
It would be pointless to try and do anything more since this
all should be optimized away above us. */
- if (cond_code == LT_EXPR && compare_values (max, min) == 0)
+ if ((cond_code == LT_EXPR
+ && compare_values (max, min) == 0)
+ || is_overflow_infinity (max))
set_value_range_to_varying (vr_p);
else
{
/* For LT_EXPR, we create the range [MIN, MAX - 1]. */
- if (cond_code == LT_EXPR
- && !is_positive_overflow_infinity (max))
+ if (cond_code == LT_EXPR)
{
tree one = build_int_cst (type, 1);
max = fold_build2 (MINUS_EXPR, type, max, one);
@@ -1169,13 +1170,14 @@ extract_range_from_assert (value_range_t *vr_p, tree expr)
/* If the minimum value forces us to be out of bounds, simply punt.
It would be pointless to try and do anything more since this
all should be optimized away above us. */
- if (cond_code == GT_EXPR && compare_values (min, max) == 0)
+ if ((cond_code == GT_EXPR
+ && compare_values (min, max) == 0)
+ || is_overflow_infinity (min))
set_value_range_to_varying (vr_p);
else
{
/* For GT_EXPR, we create the range [MIN + 1, MAX]. */
- if (cond_code == GT_EXPR
- && !is_negative_overflow_infinity (min))
+ if (cond_code == GT_EXPR)
{
tree one = build_int_cst (type, 1);
min = fold_build2 (PLUS_EXPR, type, min, one);
OpenPOWER on IntegriCloud