aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@cygnus.com>2000-05-20 10:28:17 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2000-05-20 10:28:17 +0000
commitc2b63960be7f04f76bbb692993612327c4017730 (patch)
tree213b9a374f52b0b63a22f2294f698269152ff75d /gcc/fold-const.c
parent469c2b9cac77f4f8333589cc254d9220e59478e6 (diff)
downloadgcc-c2b63960be7f04f76bbb692993612327c4017730.zip
gcc-c2b63960be7f04f76bbb692993612327c4017730.tar.gz
gcc-c2b63960be7f04f76bbb692993612327c4017730.tar.bz2
fold-const.c (make_range): Handle degenerated intervals.
* fold-const.c (make_range): Handle degenerated intervals. Fixes c-torture/execute/991221-1.c From-SVN: r34045
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 93c5816..12a8d1a 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -3455,8 +3455,17 @@ make_range (exp, pin_p, plow, phigh)
low = range_binop (PLUS_EXPR, type, n_high, 0,
integer_one_node, 0);
high = range_binop (MINUS_EXPR, type, n_low, 0,
- integer_one_node, 0);
- in_p = ! in_p;
+ integer_one_node, 0);
+
+ /* If the range is of the form +/- [ x+1, x ], we won't
+ be able to normalize it. But then, it represents the
+ whole range or the empty set, so make it
+ +/- [ -, - ]. */
+ if (tree_int_cst_equal (n_low, low)
+ && tree_int_cst_equal (n_high, high))
+ low = high = 0;
+ else
+ in_p = ! in_p;
}
else
low = n_low, high = n_high;