extract_range_from_binary_expr (value_range_t *vr, tree expr)
{
enum tree_code code = TREE_CODE (expr);
+ enum value_range_type type;
tree op0, op1, min, max;
int cmp;
value_range_t vr0 = { VR_UNDEFINED, NULL_TREE, NULL_TREE, NULL };
return;
}
+ /* The type of the resulting value range defaults to VR0.TYPE. */
+ type = vr0.type;
+
/* Refuse to operate on VARYING ranges, ranges of different kinds
and symbolic ranges. As an exception, we allow BIT_AND_EXPR
because we may be able to derive a useful range even if one of
&& tree_expr_nonnegative_p (vr0.max)
&& TREE_CODE (vr0.max) == INTEGER_CST)
{
- min = fold_convert (TREE_TYPE (expr), integer_zero_node);
+ min = build_int_cst (TREE_TYPE (expr), 0);
max = vr0.max;
}
else if (vr1.type == VR_RANGE
&& tree_expr_nonnegative_p (vr1.max)
&& TREE_CODE (vr1.max) == INTEGER_CST)
{
- vr0.type = VR_RANGE;
- min = fold_convert (TREE_TYPE (expr), integer_zero_node);
+ type = VR_RANGE;
+ min = build_int_cst (TREE_TYPE (expr), 0);
max = vr1.max;
}
else
set_value_range_to_varying (vr);
}
else
- set_value_range (vr, vr0.type, min, max, NULL);
+ set_value_range (vr, type, min, max, NULL);
}