* 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
+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>
PR middle-end/86864
}
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 vr0_min, vr0_max;
extract_range_into_wide_ints (&vr0, sign, prec, vr0_min, vr0_max);
}
/* If the new range has its limits swapped around (MIN > MAX), then
- the operation caused one of them to wrap around, mark the new
- range VARYING. */
+ the operation caused one of them to wrap around. The only thing
+ we know is that the result is positive. */
if (wi::gt_p (min, max, sign))
- return false;
+ {
+ min = wi::zero (prec);
+ max = max_value;
+ }
return true;
}