@@ -443,6 +443,8 @@ cond_exec_process_if_block (ce_if_block_t * ce_info,
rtx else_first_tail = NULL_RTX; /* First match at the tail of ELSE */
int then_n_insns, else_n_insns, n_insns;
enum rtx_code false_code;
+ bool has_return_p = FALSE;
+ rtx insn;
/* If test is comprised of && or || elements, and we've failed at handling
all of them together, just use the last test if it is the special case of
@@ -478,11 +480,19 @@ cond_exec_process_if_block (ce_if_block_t * ce_info,
n_insns = then_n_insns;
max = MAX_CONDITIONAL_EXECUTE;
+ insn = BB_END (then_bb);
+ if (JUMP_P (insn) && ANY_RETURN_P (PATTERN (insn)))
+ has_return_p = TRUE;
+
if (else_bb)
{
int n_matching;
+ insn = BB_END (else_bb);
+ if (!has_return_p && JUMP_P (insn) && ANY_RETURN_P (PATTERN (insn)))
+ has_return_p = TRUE;
- max *= 2;
+ if (!has_return_p)
+ max *= 2;
else_start = first_active_insn (else_bb);
else_end = last_active_insn (else_bb, TRUE);
else_n_insns = ce_info->num_else_insns = count_bb_insns (else_bb);