int or_op = (code == TRUTH_ORIF_EXPR || code == TRUTH_OR_EXPR);
int in0_p, in1_p, in_p;
tree low0, low1, low, high0, high1, high, lhs, rhs, tem;
- bool strict_overflow_p = false;
if (!warn_logical_op)
return;
portable code. */
op_left = unshare_expr (op_left);
walk_tree_without_duplicates (&op_left, unwrap_c_maybe_const, NULL);
- lhs = make_range (op_left, &in0_p, &low0, &high0, &strict_overflow_p);
+ lhs = make_range (op_left, &in0_p, &low0, &high0);
if (!lhs)
return;
op_right = unshare_expr (op_right);
walk_tree_without_duplicates (&op_right, unwrap_c_maybe_const, NULL);
- rhs = make_range (op_right, &in1_p, &low1, &high1, &strict_overflow_p);
+ rhs = make_range (op_right, &in1_p, &low1, &high1);
if (!rhs)
return;
tree
make_range_step (location_t loc, enum tree_code code, tree arg0, tree arg1,
- tree exp_type, tree *p_low, tree *p_high, int *p_in_p,
- bool *strict_overflow_p)
+ tree exp_type, tree *p_low, tree *p_high, int *p_in_p)
{
tree arg0_type = TREE_TYPE (arg0);
tree n_low, n_high, low = *p_low, high = *p_high;
|| (n_high != 0 && TREE_OVERFLOW (n_high)))
return NULL_TREE;
- if (TYPE_OVERFLOW_UNDEFINED (arg0_type))
- *strict_overflow_p = true;
-
normalize:
/* Check for an unsigned range which has wrapped around the maximum
value thus making n_high < n_low, and normalize it. */
variables denoted by PIN_P, PLOW, and PHIGH. Return the expression
actually being tested. *PLOW and *PHIGH will be made of the same
type as the returned expression. If EXP is not a comparison, we
- will most likely not be returning a useful value and range. Set
- *STRICT_OVERFLOW_P to true if the return value is only valid
- because signed overflow is undefined; otherwise, do not change
- *STRICT_OVERFLOW_P. */
+ will most likely not be returning a useful value and range. */
tree
-make_range (tree exp, int *pin_p, tree *plow, tree *phigh,
- bool *strict_overflow_p)
+make_range (tree exp, int *pin_p, tree *plow, tree *phigh)
{
enum tree_code code;
tree arg0, arg1 = NULL_TREE;
break;
nexp = make_range_step (loc, code, arg0, arg1, exp_type, &low,
- &high, &in_p, strict_overflow_p);
+ &high, &in_p);
if (nexp == NULL_TREE)
break;
exp = nexp;
|| code == TRUTH_OR_EXPR);
int in0_p, in1_p, in_p;
tree low0, low1, low, high0, high1, high;
- bool strict_overflow_p = false;
tree tem, lhs, rhs;
- const char * const warnmsg = G_("assuming signed overflow does not occur "
- "when simplifying range test");
if (!INTEGRAL_TYPE_P (type))
return 0;
- lhs = make_range (op0, &in0_p, &low0, &high0, &strict_overflow_p);
+ lhs = make_range (op0, &in0_p, &low0, &high0);
/* If op0 is known true or false and this is a short-circuiting
operation we must not merge with op1 since that makes side-effects
unconditional. So special-case this. */
&& ((code == TRUTH_ORIF_EXPR && in0_p)
|| (code == TRUTH_ANDIF_EXPR && !in0_p)))
return op0;
- rhs = make_range (op1, &in1_p, &low1, &high1, &strict_overflow_p);
+ rhs = make_range (op1, &in1_p, &low1, &high1);
/* If this is an OR operation, invert both sides; we will invert
again at the end. */
: rhs != 0 ? rhs : integer_zero_node,
in_p, low, high))) != 0)
{
- if (strict_overflow_p)
- fold_overflow_warning (warnmsg, WARN_STRICT_OVERFLOW_COMPARISON);
return or_op ? invert_truthvalue_loc (loc, tem) : tem;
}
or_op ? ! in1_p : in1_p,
low1, high1)) != 0)
{
- if (strict_overflow_p)
- fold_overflow_warning (warnmsg,
- WARN_STRICT_OVERFLOW_COMPARISON);
return build2_loc (loc, code == TRUTH_ANDIF_EXPR
? TRUTH_AND_EXPR : TRUTH_OR_EXPR,
type, lhs, rhs);
extern bool tree_expr_nan_p (const_tree);
extern bool tree_expr_maybe_nan_p (const_tree);
extern bool tree_expr_maybe_real_minus_zero_p (const_tree);
-extern tree make_range (tree, int *, tree *, tree *, bool *);
+extern tree make_range (tree, int *, tree *, tree *);
extern tree make_range_step (location_t, enum tree_code, tree, tree, tree,
- tree *, tree *, int *, bool *);
+ tree *, tree *, int *);
extern tree range_check_type (tree);
extern tree build_range_check (location_t, tree, tree, int, tree, tree);
extern bool merge_ranges (int *, tree *, tree *, int, tree, tree, int,