+2002-07-15 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * 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 <jakub@redhat.com>
PR middle-end/7245
/* 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. */
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;
(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))
(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;
")