static bool
overflow_comparison_p_1 (enum tree_code code, tree op0, tree op1,
- bool follow_assert_exprs, bool reversed, tree *new_cst)
+ bool reversed, tree *new_cst)
{
/* See if this is a relational operation between two SSA_NAMES with
unsigned, overflow wrapping values. If so, check it more deeply. */
{
gimple *op1_def = SSA_NAME_DEF_STMT (op1);
- /* If requested, follow any ASSERT_EXPRs backwards for OP1. */
- if (follow_assert_exprs)
- {
- while (gimple_assign_single_p (op1_def)
- && TREE_CODE (gimple_assign_rhs1 (op1_def)) == ASSERT_EXPR)
- {
- op1 = TREE_OPERAND (gimple_assign_rhs1 (op1_def), 0);
- if (TREE_CODE (op1) != SSA_NAME)
- break;
- op1_def = SSA_NAME_DEF_STMT (op1);
- }
- }
-
/* Now look at the defining statement of OP1 to see if it adds
or subtracts a nonzero constant from another operand. */
if (op1_def
{
tree target = gimple_assign_rhs1 (op1_def);
- /* If requested, follow ASSERT_EXPRs backwards for op0 looking
- for one where TARGET appears on the RHS. */
- if (follow_assert_exprs)
- {
- /* Now see if that "other operand" is op0, following the chain
- of ASSERT_EXPRs if necessary. */
- gimple *op0_def = SSA_NAME_DEF_STMT (op0);
- while (op0 != target
- && gimple_assign_single_p (op0_def)
- && TREE_CODE (gimple_assign_rhs1 (op0_def)) == ASSERT_EXPR)
- {
- op0 = TREE_OPERAND (gimple_assign_rhs1 (op0_def), 0);
- if (TREE_CODE (op0) != SSA_NAME)
- break;
- op0_def = SSA_NAME_DEF_STMT (op0);
- }
- }
-
/* If we did not find our target SSA_NAME, then this is not
an overflow test. */
if (op0 != target)
the alternate range representation is often useful within VRP. */
bool
-overflow_comparison_p (tree_code code, tree name, tree val,
- bool use_equiv_p, tree *new_cst)
+overflow_comparison_p (tree_code code, tree name, tree val, tree *new_cst)
{
- if (overflow_comparison_p_1 (code, name, val, use_equiv_p, false, new_cst))
+ if (overflow_comparison_p_1 (code, name, val, false, new_cst))
return true;
return overflow_comparison_p_1 (swap_tree_comparison (code), val, name,
- use_equiv_p, true, new_cst);
+ true, new_cst);
}
/* Handle
extern bool find_case_label_range (gswitch *, tree, tree, size_t *, size_t *);
extern tree find_case_label_range (gswitch *, const irange *vr);
extern bool find_case_label_index (gswitch *, size_t, tree, size_t *);
-extern bool overflow_comparison_p (tree_code, tree, tree, bool, tree *);
+extern bool overflow_comparison_p (tree_code, tree, tree, tree *);
extern void maybe_set_nonzero_bits (edge, tree);
#endif /* GCC_TREE_VRP_H */
occurs when the chosen argument is zero and does not occur if the
chosen argument is not zero. */
tree x;
- if (overflow_comparison_p (code, op0, op1, use_equiv_p, &x))
+ if (overflow_comparison_p (code, op0, op1, &x))
{
wide_int max = wi::max_value (TYPE_PRECISION (TREE_TYPE (op0)), UNSIGNED);
/* B = A - 1; if (A < B) -> B = A - 1; if (A == 0)