aboutsummaryrefslogtreecommitdiff
path: root/gcc/flow.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2001-07-23 17:27:33 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2001-07-23 15:27:33 +0000
commit0dd94abd70d7b14b56d60eac7333cdd9f028d278 (patch)
treeea8d0ee2d60a45012614cd8b419e733902d4bfca /gcc/flow.c
parent0005550b5832aa6f0a3d7f343319c6b5b327dde8 (diff)
downloadgcc-0dd94abd70d7b14b56d60eac7333cdd9f028d278.zip
gcc-0dd94abd70d7b14b56d60eac7333cdd9f028d278.tar.gz
gcc-0dd94abd70d7b14b56d60eac7333cdd9f028d278.tar.bz2
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
Diffstat (limited to 'gcc/flow.c')
-rw-r--r--gcc/flow.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/flow.c b/gcc/flow.c
index ac5cee5..12712f2 100644
--- a/gcc/flow.c
+++ b/gcc/flow.c
@@ -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;
}