Commit 405862dd by Jim Wilson

(merge_ranges): In (+,-) case, treat subset specially

if lower bounds are the same.

From-SVN: r13127
parent 9e62c7f2
...@@ -2963,16 +2963,20 @@ merge_ranges (pin_p, plow, phigh, in0_p, low0, high0, in1_p, low1, high1) ...@@ -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 /* 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 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 a single range unless both ranges end at the same place. If both
case we can ignore the fact that it's a subset. Otherwise, we go ranges also start in the same place, then the result is false.
from the start of the first range to just before the start of the Otherwise, we go from the start of the first range to just before
second. */ the start of the second. */
if (no_overlap) if (no_overlap)
in_p = 1, low = low0, high = high0; in_p = 1, low = low0, high = high0;
else if (subset else if (subset
&& integer_zerop (range_binop (EQ_EXPR, integer_type_node, && integer_zerop (range_binop (EQ_EXPR, integer_type_node,
high0, 1, high1, 0))) high0, 1, high1, 0)))
return 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 else
{ {
in_p = 1, low = low0; in_p = 1, low = low0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment