return false;
}
-/* Return true if (CODE OP0 OP1) is known to be non-negative. If the return
- value is based on the assumption that signed overflow is undefined,
- set *STRICT_OVERFLOW_P to true; otherwise, don't change
- *STRICT_OVERFLOW_P. DEPTH is the current nesting depth of the query. */
+/* Return true if (CODE OP0 OP1) is known to be non-negative.
+ DEPTH is the current nesting depth of the query. */
bool
-tree_binary_nonnegative_warnv_p (enum tree_code code, tree type, tree op0,
- tree op1, bool *strict_overflow_p,
- int depth)
+tree_binary_nonnegative_p (enum tree_code code, tree type, tree op0,
+ tree op1, int depth)
{
if (TYPE_UNSIGNED (type))
return true;
+ /* The RECURSE () macro counts with a strict_overflow_p bool
+ pointer being declared beforehand. */
+ bool val = false;
+ bool *strict_overflow_p = &val;
+
switch (code)
{
case POINTER_PLUS_EXPR:
or without overflow. */
if (operand_equal_p (op0, op1, 0)
|| (RECURSE (op0) && RECURSE (op1)))
- {
- if (ANY_INTEGRAL_TYPE_P (type)
- && TYPE_OVERFLOW_UNDEFINED (type))
- *strict_overflow_p = true;
- return true;
- }
+ return true;
}
/* zero_extend(x) * zero_extend(y) is non-negative if x and y are
{
case tcc_binary:
case tcc_comparison:
- return tree_binary_nonnegative_warnv_p (TREE_CODE (t),
- TREE_TYPE (t),
- TREE_OPERAND (t, 0),
- TREE_OPERAND (t, 1),
- strict_overflow_p, depth);
+ return tree_binary_nonnegative_p (TREE_CODE (t),
+ TREE_TYPE (t),
+ TREE_OPERAND (t, 0),
+ TREE_OPERAND (t, 1),
+ depth);
case tcc_unary:
return tree_unary_nonnegative_warnv_p (TREE_CODE (t),
case TRUTH_AND_EXPR:
case TRUTH_OR_EXPR:
case TRUTH_XOR_EXPR:
- return tree_binary_nonnegative_warnv_p (TREE_CODE (t),
- TREE_TYPE (t),
- TREE_OPERAND (t, 0),
- TREE_OPERAND (t, 1),
- strict_overflow_p, depth);
+ return tree_binary_nonnegative_p (TREE_CODE (t),
+ TREE_TYPE (t),
+ TREE_OPERAND (t, 0),
+ TREE_OPERAND (t, 1),
+ depth);
case TRUTH_NOT_EXPR:
return tree_unary_nonnegative_warnv_p (TREE_CODE (t),
TREE_TYPE (t),
extern bool tree_single_nonzero_p (tree);
extern bool tree_unary_nonnegative_warnv_p (enum tree_code, tree, tree,
bool *, int);
-extern bool tree_binary_nonnegative_warnv_p (enum tree_code, tree, tree, tree,
- bool *, int);
+extern bool tree_binary_nonnegative_p (enum tree_code, tree, tree, tree, int);
extern bool tree_single_nonnegative_warnv_p (tree, bool *, int);
extern bool tree_call_nonnegative_warnv_p (tree, combined_fn, tree, tree,
bool *, int);
gimple_assign_rhs1 (stmt),
strict_overflow_p, depth);
case GIMPLE_BINARY_RHS:
- return tree_binary_nonnegative_warnv_p (gimple_assign_rhs_code (stmt),
- type,
- gimple_assign_rhs1 (stmt),
- gimple_assign_rhs2 (stmt),
- strict_overflow_p, depth);
+ return tree_binary_nonnegative_p (gimple_assign_rhs_code (stmt),
+ type,
+ gimple_assign_rhs1 (stmt),
+ gimple_assign_rhs2 (stmt),
+ depth);
case GIMPLE_TERNARY_RHS:
return false;
case GIMPLE_SINGLE_RHS: