From 405862dd6c6a941cbadf615492708bff8679a1e2 Mon Sep 17 00:00:00 2001 From: Jim Wilson Date: Tue, 12 Nov 1996 10:19:42 -0800 Subject: [PATCH] (merge_ranges): In (+,-) case, treat subset specially if lower bounds are the same. From-SVN: r13127 --- gcc/fold-const.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gcc/fold-const.c b/gcc/fold-const.c index b3f43657d2c..1ddfd478208 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; -- 2.30.2