- tmp_cond = second_bb->aux;
- if (TREE_CODE (tmp_cond) == TRUTH_NOT_EXPR)
- {
- /* Select non loop header condition but do not switch basic blocks. */
- *cond = invert_truthvalue (unshare_expr (tmp_cond));
- }
+ *cond = (second_edge->src)->aux;
+
+ /* If there is a condition on an incoming edge,
+ AND it with the incoming bb predicate. */
+ if (second_edge->aux)
+ *cond = build2 (TRUTH_AND_EXPR, boolean_type_node,
+ *cond, first_edge->aux);
+
+ if (TREE_CODE (*cond) == TRUTH_NOT_EXPR)
+ /* We can be smart here and choose inverted
+ condition without switching bbs. */
+ *cond = invert_truthvalue (*cond);