enum tree_code rhs_code = gimple_assign_rhs_code (def_stmt);
const tree rhs1 = gimple_assign_rhs1 (def_stmt);
const tree rhs2 = gimple_assign_rhs2 (def_stmt);
- const tree zero_cst = build_zero_cst (TREE_TYPE (op0));
- const tree one_cst = build_one_cst (TREE_TYPE (op0));
/* Is A != 0 ? */
const tree res1
{
/* If A == 0 then (A & B) != 0 is always false. */
if (cond_code == NE_EXPR)
- return zero_cst;
+ return boolean_false_node;
/* If A == 0 then (A & B) == 0 is always true. */
if (cond_code == EQ_EXPR)
- return one_cst;
+ return boolean_true_node;
}
else if (rhs_code == BIT_IOR_EXPR && integer_nonzerop (res1))
{
/* If A != 0 then (A | B) != 0 is always true. */
if (cond_code == NE_EXPR)
- return one_cst;
+ return boolean_true_node;
/* If A != 0 then (A | B) == 0 is always false. */
if (cond_code == EQ_EXPR)
- return zero_cst;
+ return boolean_false_node;
}
/* Is B != 0 ? */
{
/* If B == 0 then (A & B) != 0 is always false. */
if (cond_code == NE_EXPR)
- return zero_cst;
+ return boolean_false_node;
/* If B == 0 then (A & B) == 0 is always true. */
if (cond_code == EQ_EXPR)
- return one_cst;
+ return boolean_true_node;
}
else if (rhs_code == BIT_IOR_EXPR && integer_nonzerop (res2))
{
/* If B != 0 then (A | B) != 0 is always true. */
if (cond_code == NE_EXPR)
- return one_cst;
+ return boolean_true_node;
/* If B != 0 then (A | B) == 0 is always false. */
if (cond_code == EQ_EXPR)
- return zero_cst;
+ return boolean_false_node;
}
if (res1 != NULL_TREE && res2 != NULL_TREE)
{
/* If A != 0 and B != 0 then (bool)(A & B) != 0 is true. */
if (cond_code == NE_EXPR)
- return one_cst;
+ return boolean_true_node;
/* If A != 0 and B != 0 then (bool)(A & B) == 0 is false. */
if (cond_code == EQ_EXPR)
- return zero_cst;
+ return boolean_false_node;
}
if (rhs_code == BIT_IOR_EXPR
{
/* If A == 0 and B == 0 then (A | B) != 0 is false. */
if (cond_code == NE_EXPR)
- return zero_cst;
+ return boolean_false_node;
/* If A == 0 and B == 0 then (A | B) == 0 is true. */
if (cond_code == EQ_EXPR)
- return one_cst;
+ return boolean_true_node;
}
}
}