aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1996-11-12 10:19:42 -0800
committerJim Wilson <wilson@gcc.gnu.org>1996-11-12 10:19:42 -0800
commit405862dd6c6a941cbadf615492708bff8679a1e2 (patch)
treeb80f61d806fd2c5f2467c0f78664d77f18b27264 /gcc/fold-const.c
parent9e62c7f28dcfe66e7dfd5e2195e2e67b731bfdda (diff)
downloadgcc-405862dd6c6a941cbadf615492708bff8679a1e2.zip
gcc-405862dd6c6a941cbadf615492708bff8679a1e2.tar.gz
gcc-405862dd6c6a941cbadf615492708bff8679a1e2.tar.bz2
(merge_ranges): In (+,-) case, treat subset specially
if lower bounds are the same. From-SVN: r13127
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index b3f4365..1ddfd47 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -2963,16 +2963,20 @@ merge_ranges (pin_p, plow, phigh, in0_p, low0, high0, in1_p, low1, high1)
{
/* If they don't overlap, the result is the first range. If the
second range is a subset of the first, we can't describe this as
- a single range unless both ranges end at the same place, in which
- case we can ignore the fact that it's a subset. Otherwise, we go
- from the start of the first range to just before the start of the
- second. */
+ a single range unless both ranges end at the same place. If both
+ ranges also start in the same place, then the result is false.
+ Otherwise, we go from the start of the first range to just before
+ the start of the second. */
if (no_overlap)
in_p = 1, low = low0, high = high0;
else if (subset
&& integer_zerop (range_binop (EQ_EXPR, integer_type_node,
high0, 1, high1, 0)))
return 0;
+ else if (subset
+ && integer_onep (range_binop (EQ_EXPR, integer_type_node,
+ low0, 0, low1, 0)))
+ in_p = 0, low = high = 0;
else
{
in_p = 1, low = low0;