+2018-10-17 Aldy Hernandez <aldyh@redhat.com>
+
+ * tree-vrp.c (extract_range_from_multiplicative_op): Remove
+ overflow wraps argument.
+ (extract_range_from_binary_expr_1): Do not pass overflow wraps to
+ wide_int_range_multiplicative_op.
+ * wide-int-range.cc (wide_int_range_mult_wrapping): Remove
+ overflow wraps argument.
+ (wide_int_range_multiplicative_op): Same.
+ (wide_int_range_lshift): Same.
+ (wide_int_range_div): Same.
+ * wide-int-range.h (wide_int_range_multiplicative_op): Same.
+ (wide_int_range_lshift): Same.
+ (wide_int_range_div): Same.
+
2018-10-17 Aldy Hernandez <aldyh@redhat.com>
* wide-int-range.h (wide_int_range_shift_undefined_p): Adjust to
wide_int vr1_lb = wi::to_wide (vr1->min);
wide_int vr1_ub = wi::to_wide (vr1->max);
bool overflow_undefined = TYPE_OVERFLOW_UNDEFINED (type);
- bool overflow_wraps = TYPE_OVERFLOW_WRAPS (type);
unsigned prec = TYPE_PRECISION (type);
if (wide_int_range_multiplicative_op (res_lb, res_ub,
- code, TYPE_SIGN (type), prec,
- vr0_lb, vr0_ub, vr1_lb, vr1_ub,
- overflow_undefined, overflow_wraps))
+ code, TYPE_SIGN (type), prec,
+ vr0_lb, vr0_ub, vr1_lb, vr1_ub,
+ overflow_undefined))
set_and_canonicalize_value_range (vr, VR_RANGE,
wide_int_to_tree (type, res_lb),
wide_int_to_tree (type, res_ub), NULL);
wi::to_wide (vr0.max),
wi::to_wide (vr1.min),
wi::to_wide (vr1.max),
- TYPE_OVERFLOW_UNDEFINED (expr_type),
- TYPE_OVERFLOW_WRAPS (expr_type)))
+ TYPE_OVERFLOW_UNDEFINED (expr_type)))
{
min = wide_int_to_tree (expr_type, res_lb);
max = wide_int_to_tree (expr_type, res_ub);
dividend_min, dividend_max,
divisor_min, divisor_max,
TYPE_OVERFLOW_UNDEFINED (expr_type),
- TYPE_OVERFLOW_WRAPS (expr_type),
extra_range_p, extra_min, extra_max))
{
set_value_range_to_varying (vr);
Return TRUE if we were able to perform the operation.
- NOTE: If code is MULT_EXPR and TYPE_OVERFLOW_WRAPS, the resulting
+ NOTE: If code is MULT_EXPR and !TYPE_OVERFLOW_UNDEFINED, the resulting
range must be canonicalized by the caller because its components
may be swapped. */
const wide_int &vr0_ub,
const wide_int &vr1_lb,
const wide_int &vr1_ub,
- bool overflow_undefined,
- bool overflow_wraps)
+ bool overflow_undefined)
{
/* Multiplications, divisions and shifts are a bit tricky to handle,
depending on the mix of signs we have in the two ranges, we
(MIN0 OP MIN1, MIN0 OP MAX1, MAX0 OP MIN1 and MAX0 OP MAX0 OP
MAX1) and then figure the smallest and largest values to form
the new range. */
- if (code == MULT_EXPR && overflow_wraps)
+ if (code == MULT_EXPR && !overflow_undefined)
return wide_int_range_mult_wrapping (res_lb, res_ub,
sign, prec,
vr0_lb, vr0_ub, vr1_lb, vr1_ub);
signop sign, unsigned prec,
const wide_int &vr0_lb, const wide_int &vr0_ub,
const wide_int &vr1_lb, const wide_int &vr1_ub,
- bool overflow_undefined, bool overflow_wraps)
+ bool overflow_undefined)
{
/* Transform left shifts by constants into multiplies. */
if (wi::eq_p (vr1_lb, vr1_ub))
return wide_int_range_multiplicative_op (res_lb, res_ub,
MULT_EXPR, sign, prec,
vr0_lb, vr0_ub, tmp, tmp,
- overflow_undefined,
- /*overflow_wraps=*/true);
+ /*overflow_undefined=*/false);
}
int overflow_pos = prec;
LSHIFT_EXPR, sign, prec,
vr0_lb, vr0_ub,
vr1_lb, vr1_ub,
- overflow_undefined,
- overflow_wraps);
+ overflow_undefined);
return false;
}
const wide_int ÷nd_min, const wide_int ÷nd_max,
const wide_int &divisor_min, const wide_int &divisor_max,
bool overflow_undefined,
- bool overflow_wraps,
bool &extra_range_p,
wide_int &extra_min, wide_int &extra_max)
{
return wide_int_range_multiplicative_op (wmin, wmax, code, sign, prec,
dividend_min, dividend_max,
divisor_min, divisor_max,
- overflow_undefined,
- overflow_wraps);
+ overflow_undefined);
/* If flag_non_call_exceptions, we must not eliminate a division
by zero. */
code, sign, prec,
dividend_min, dividend_max,
divisor_min, wi::minus_one (prec),
- overflow_undefined,
- overflow_wraps))
+ overflow_undefined))
return false;
extra_range_p = true;
}
code, sign, prec,
dividend_min, dividend_max,
wi::one (prec), divisor_max,
- overflow_undefined,
- overflow_wraps))
+ overflow_undefined))
return false;
}
else
const wide_int &vr0_ub,
const wide_int &vr1_lb,
const wide_int &vr1_ub,
- bool overflow_undefined,
- bool overflow_wraps);
+ bool overflow_undefined);
extern bool wide_int_range_lshift (wide_int &res_lb, wide_int &res_ub,
signop sign, unsigned prec,
const wide_int &, const wide_int &,
const wide_int &, const wide_int &,
- bool overflow_undefined,
- bool overflow_wraps);
+ bool overflow_undefined);
extern void wide_int_range_set_zero_nonzero_bits (signop,
const wide_int &lb,
const wide_int &ub,
const wide_int &divisor_min,
const wide_int &divisor_max,
bool overflow_undefined,
- bool overflow_wraps,
bool &extra_range_p,
wide_int &extra_min, wide_int &extra_max);