+2017-09-22 Richard Sandiford <richard.sandiford@linaro.org>
+ Alan Hayward <alan.hayward@arm.com>
+ David Sherwood <david.sherwood@arm.com>
+
+ * tree-vrp.c (extract_range_from_multiplicative_op_1): Assert
+ for VR_RANGE only; don't allow VR_ANTI_RANGE.
+ (extract_range_from_binary_expr_1): Don't call
+ extract_range_from_multiplicative_op_1 if !range_int_cst_p.
+
2017-09-22 Richard Sandiford <richard.sandiford@linaro.org>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
|| code == ROUND_DIV_EXPR
|| code == RSHIFT_EXPR
|| code == LSHIFT_EXPR);
- gcc_assert ((vr0->type == VR_RANGE
- || (code == MULT_EXPR && vr0->type == VR_ANTI_RANGE))
+ gcc_assert (vr0->type == VR_RANGE
&& vr0->type == vr1->type);
rtype = vr0->type;
signop sign = TYPE_SIGN (expr_type);
unsigned int prec = TYPE_PRECISION (expr_type);
- if (range_int_cst_p (&vr0)
- && range_int_cst_p (&vr1)
- && TYPE_OVERFLOW_WRAPS (expr_type))
+ if (!range_int_cst_p (&vr0)
+ || !range_int_cst_p (&vr1))
+ {
+ set_value_range_to_varying (vr);
+ return;
+ }
+
+ if (TYPE_OVERFLOW_WRAPS (expr_type))
{
typedef FIXED_WIDE_INT (WIDE_INT_MAX_PRECISION * 2) vrp_int;
typedef generic_wide_int