{
tree cond = fold (COND_EXPR_COND (stmt));
if (integer_zerop (cond))
- COND_EXPR_COND (stmt) = integer_zero_node;
+ COND_EXPR_COND (stmt) = boolean_false_node;
else if (integer_onep (cond))
- COND_EXPR_COND (stmt) = integer_one_node;
+ COND_EXPR_COND (stmt) = boolean_true_node;
}
}
}
edge true_edge, false_edge;
extract_true_false_edges_from_block (bb, &true_edge, &false_edge);
-
- /* Otherwise, try to determine which branch of the if() will be taken.
- If VAL is a constant but it can't be reduced to a 0 or a 1, then
- we don't really know which edge will be taken at runtime. This
- may happen when comparing addresses (e.g., if (&var1 == 4)). */
- if (integer_nonzerop (val))
- return true_edge;
- else if (integer_zerop (val))
- return false_edge;
-
- gcc_unreachable ();
+
+ gcc_assert (TREE_CODE (val) == INTEGER_CST);
+ return (zero_p (val) ? false_edge : true_edge);
}
-
/* Given an INTEGER_CST VAL and the entry block BB to a SWITCH_EXPR
statement, determine which edge will be taken out of the block. Return
NULL if any edge may be taken. */