From: John David Anglin Date: Mon, 15 Jul 2002 16:19:39 +0000 (+0000) Subject: bb-reorder.c (make_reorder_chain_1): Search harder for the vax casesi fallthru edge. X-Git-Tag: releases/gcc-3.1.1~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5c8414d4ad2c958e817780c465cc01487a70b0e8;p=thirdparty%2Fgcc.git bb-reorder.c (make_reorder_chain_1): Search harder for the vax casesi fallthru edge. * bb-reorder.c (make_reorder_chain_1): Search harder for the vax casesi fallthru edge. * cfgrtl.c (force_nonfallthru_and_redirect): Place redirection block after ADDR_VEC. * vax.md (casesi): Use emit_jump_insn. Remove unused constraints. From-SVN: r55460 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8166b8722f6f..3ae692d2874a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2002-07-15 John David Anglin + + * bb-reorder.c (make_reorder_chain_1): Search harder for the vax + casesi fallthru edge. + * cfgrtl.c (force_nonfallthru_and_redirect): Place redirection + block after ADDR_VEC. + * vax.md (casesi): Use emit_jump_insn. Remove unused constraints. + 2002-07-15 Jakub Jelinek PR middle-end/7245 diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c index 2578604889ec..b0cc46215ea6 100644 --- a/gcc/bb-reorder.c +++ b/gcc/bb-reorder.c @@ -211,17 +211,21 @@ make_reorder_chain_1 (bb, prev) /* In the absence of a prediction, disturb things as little as possible by selecting the old "next" block from the list of successors. If there had been a fallthru edge, that will be the one. */ + /* Note that the fallthru block may not be next any time we eliminate + forwarder blocks. */ if (! next) { for (e = bb->succ; e ; e = e->succ_next) - if (e->dest->index == bb->index + 1) + if (e->flags & EDGE_FALLTHRU) { - if ((e->flags & EDGE_FALLTHRU) - || (e->dest->succ - && ! (e->flags & (EDGE_ABNORMAL_CALL | EDGE_EH)))) - next = e->dest; + next = e->dest; break; } + else if (e->dest->index == bb->index + 1) + { + if (! (e->flags & (EDGE_ABNORMAL_CALL | EDGE_EH))) + next = e->dest; + } } /* Make sure we didn't select a silly next block. */ diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c index e57c88a7b5bc..bbcdfbb1bfc5 100644 --- a/gcc/cfgrtl.c +++ b/gcc/cfgrtl.c @@ -953,9 +953,21 @@ force_nonfallthru_and_redirect (e, target) if (e->src->succ->succ_next) { /* Create the new structures. */ + + /* Position the new block correctly relative to loop notes. */ note = last_loop_beg_note (e->src->end); - jump_block - = create_basic_block (e->src->index + 1, NEXT_INSN (note), NULL); + note = NEXT_INSN (note); + + /* ... and ADDR_VECs. */ + if (note != NULL + && GET_CODE (note) == CODE_LABEL + && NEXT_INSN (note) + && GET_CODE (NEXT_INSN (note)) == JUMP_INSN + && (GET_CODE (PATTERN (NEXT_INSN (note))) == ADDR_DIFF_VEC + || GET_CODE (PATTERN (NEXT_INSN (note))) == ADDR_VEC)) + note = NEXT_INSN (NEXT_INSN (note)); + + jump_block = create_basic_block (e->src->index + 1, note, NULL); jump_block->count = e->count; jump_block->frequency = EDGE_FREQUENCY (e); jump_block->loop_depth = target->loop_depth; diff --git a/gcc/config/vax/vax.md b/gcc/config/vax/vax.md index c19427908df3..5aa3621a4239 100644 --- a/gcc/config/vax/vax.md +++ b/gcc/config/vax/vax.md @@ -1933,9 +1933,9 @@ (define_expand "casesi" [(set (pc) (if_then_else - (leu (minus:SI (match_operand:SI 0 "general_operand" "g") - (match_operand:SI 1 "general_operand" "g")) - (match_operand:SI 2 "general_operand" "g")) + (leu (minus:SI (match_operand:SI 0 "general_operand" "") + (match_operand:SI 1 "general_operand" "")) + (match_operand:SI 2 "general_operand" "")) (plus:SI (sign_extend:SI (mem:HI (plus:SI (mult:SI (minus:SI (match_dup 0) (match_dup 1)) @@ -1946,7 +1946,7 @@ (match_operand 4 "" "")] "" " - emit_insn (gen_casesi1 (operands[0], operands[1], operands[2], operands[3])); + emit_jump_insn (gen_casesi1 (operands[0], operands[1], operands[2], operands[3])); DONE; ")