summaryrefslogtreecommitdiffstats
path: root/contrib/gcc/fold-const.c
diff options
context:
space:
mode:
authorkan <kan@FreeBSD.org>2007-08-14 02:45:23 +0000
committerkan <kan@FreeBSD.org>2007-08-14 02:45:23 +0000
commitd2ff90cc580c62afb8528917c1c80ac49d9aaa01 (patch)
tree7b2fa7d3de8706d9ca72fdb284ce2a57f67d460a /contrib/gcc/fold-const.c
parent8a2681fa7ee14c49235e12318f7de5a9a7f492ea (diff)
downloadFreeBSD-src-d2ff90cc580c62afb8528917c1c80ac49d9aaa01.zip
FreeBSD-src-d2ff90cc580c62afb8528917c1c80ac49d9aaa01.tar.gz
GCC 4.2.1 release.
Diffstat (limited to 'contrib/gcc/fold-const.c')
-rw-r--r--contrib/gcc/fold-const.c33
1 files changed, 27 insertions, 6 deletions
diff --git a/contrib/gcc/fold-const.c b/contrib/gcc/fold-const.c
index 56897ab..5db1d84 100644
--- a/contrib/gcc/fold-const.c
+++ b/contrib/gcc/fold-const.c
@@ -4450,13 +4450,24 @@ merge_ranges (int *pin_p, tree *plow, tree *phigh, int in0_p, tree low0,
{
low = range_successor (high1);
high = high0;
- in_p = (low != 0);
+ in_p = 1;
+ if (low == 0)
+ {
+ /* We are in the weird situation where high0 > high1 but
+ high1 has no successor. Punt. */
+ return 0;
+ }
}
else if (! subset || highequal)
{
low = low0;
high = range_predecessor (low1);
- in_p = (high != 0);
+ in_p = 1;
+ if (high == 0)
+ {
+ /* low0 < low1 but low1 has no predecessor. Punt. */
+ return 0;
+ }
}
else
return 0;
@@ -4476,7 +4487,12 @@ merge_ranges (int *pin_p, tree *plow, tree *phigh, int in0_p, tree low0,
{
low = range_successor (high0);
high = high1;
- in_p = (low != 0);
+ in_p = 1;
+ if (low == 0)
+ {
+ /* high1 > high0 but high0 has no successor. Punt. */
+ return 0;
+ }
}
}
@@ -12634,9 +12650,14 @@ tree_expr_nonnegative_warnv_p (tree t, bool *strict_overflow_p)
/* ... fall through ... */
default:
- if (truth_value_p (TREE_CODE (t)))
- /* Truth values evaluate to 0 or 1, which is nonnegative. */
- return 1;
+ {
+ tree type = TREE_TYPE (t);
+ if ((TYPE_PRECISION (type) != 1 || TYPE_UNSIGNED (type))
+ && truth_value_p (TREE_CODE (t)))
+ /* Truth values evaluate to 0 or 1, which is nonnegative unless we
+ have a signed:1 type (where the value is -1 and 0). */
+ return true;
+ }
}
/* We don't know sign of `t', so be conservative and return false. */
OpenPOWER on IntegriCloud