flow.c (try_simplify_condjump): Unlink insn chain on fallthru edge; use can_fallthru.

* flow.c (try_simplify_condjump): Unlink insn chain on
	fallthru edge; use can_fallthru.

From-SVN: r44268
This commit is contained in:
Jan Hubicka 2001-07-23 17:27:33 +02:00 committed by Jan Hubicka
parent 0005550b58
commit 0dd94abd70
2 changed files with 11 additions and 1 deletions

View File

@ -1,3 +1,8 @@
Mon Jul 23 17:20:18 CEST 2001 Jan Hubicka <jh@suse.cz>
* flow.c (try_simplify_condjump): Unlink insn chain on
fallthru edge; use can_fallthru.
Mon Jul 23 16:03:19 CEST 2001 Jan Hubicka <jh@suse.cz>
* basic-block.h (find_sub_basic_block): Declare.

View File

@ -3056,7 +3056,8 @@ try_simplify_condjump (cbranch_block)
/* The conditional branch must target the block after the
unconditional branch. */
cbranch_dest_block = cbranch_jump_edge->dest;
if (cbranch_dest_block->index != jump_block->index + 1)
if (!can_fallthru (jump_block, cbranch_dest_block))
return false;
/* Invert the conditional branch. Prevent jump.c from deleting
@ -3079,6 +3080,10 @@ try_simplify_condjump (cbranch_block)
cbranch_fallthru_edge->flags &= ~EDGE_FALLTHRU;
flow_delete_block (jump_block);
/* Selectively unlink the sequence. */
if (cbranch_jump_edge->src->end != PREV_INSN (cbranch_jump_edge->dest->head))
flow_delete_insn_chain (NEXT_INSN (cbranch_jump_edge->src->end),
PREV_INSN (cbranch_jump_edge->dest->head));
return true;
}