Commit 3cc2fdfd by Aldy Hernandez Committed by Aldy Hernandez

tree-vrp.c (extract_range_from_unary_expr): Do not special case symbolics or…

tree-vrp.c (extract_range_from_unary_expr): Do not special case symbolics or VR_VARYING ranges for ABS_EXPR.

	* tree-vrp.c (extract_range_from_unary_expr): Do not special case
	symbolics or VR_VARYING ranges for ABS_EXPR.
	* wide-int-range.cc (wide_int_range_abs): Return positive numbers
	when range will wrap.

From-SVN: r264356
parent baeab78d
2018-09-17 Aldy Hernandez <aldyh@redhat.com>
* tree-vrp.c (extract_range_from_unary_expr): Do not special case
symbolics or VR_VARYING ranges for ABS_EXPR.
* wide-int-range.cc (wide_int_range_abs): Return positive numbers
when range will wrap.
2018-09-15 Eric Botcazou <ebotcazou@adacore.com> 2018-09-15 Eric Botcazou <ebotcazou@adacore.com>
PR middle-end/86864 PR middle-end/86864
......
...@@ -1894,11 +1894,6 @@ extract_range_from_unary_expr (value_range *vr, ...@@ -1894,11 +1894,6 @@ extract_range_from_unary_expr (value_range *vr,
} }
else if (code == ABS_EXPR) else if (code == ABS_EXPR)
{ {
if (vr0.type != VR_RANGE || symbolic_range_p (&vr0))
{
set_value_range_to_varying (vr);
return;
}
wide_int wmin, wmax; wide_int wmin, wmax;
wide_int vr0_min, vr0_max; wide_int vr0_min, vr0_max;
extract_range_into_wide_ints (&vr0, sign, prec, vr0_min, vr0_max); extract_range_into_wide_ints (&vr0, sign, prec, vr0_min, vr0_max);
......
...@@ -728,10 +728,13 @@ wide_int_range_abs (wide_int &min, wide_int &max, ...@@ -728,10 +728,13 @@ wide_int_range_abs (wide_int &min, wide_int &max,
} }
/* If the new range has its limits swapped around (MIN > MAX), then /* If the new range has its limits swapped around (MIN > MAX), then
the operation caused one of them to wrap around, mark the new the operation caused one of them to wrap around. The only thing
range VARYING. */ we know is that the result is positive. */
if (wi::gt_p (min, max, sign)) if (wi::gt_p (min, max, sign))
return false; {
min = wi::zero (prec);
max = max_value;
}
return true; return true;
} }
......
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