summaryrefslogtreecommitdiff
path: root/gcc/cfgcleanup.c
diff options
context:
space:
mode:
authorrearnsha <rearnsha@138bc75d-0d04-0410-961f-82ee72b054a4>2001-09-21 15:34:54 +0000
committerrearnsha <rearnsha@138bc75d-0d04-0410-961f-82ee72b054a4>2001-09-21 15:34:54 +0000
commitf70d66411c6de03f36070c1956ae3ef820efd74a (patch)
treeaaeb21d8ee48338e5538f28d75ab830d375fe6eb /gcc/cfgcleanup.c
parent1f5d5a106618f3423807b03e08821da4a7b9a155 (diff)
downloadgcc-f70d66411c6de03f36070c1956ae3ef820efd74a.tar.gz
* cfgcleanup.c (merge_blocks_move_successor_nojumps): Don't leave
ADDR_VEC or ADDR_DIFF_VEC jump insns as part of the basic block once merging is complete. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@45730 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgcleanup.c')
-rw-r--r--gcc/cfgcleanup.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c
index a3ddcac872e..c52d255d53b 100644
--- a/gcc/cfgcleanup.c
+++ b/gcc/cfgcleanup.c
@@ -319,8 +319,9 @@ static void
merge_blocks_move_successor_nojumps (a, b)
basic_block a, b;
{
- rtx barrier;
+ rtx barrier, real_b_end;
+ real_b_end = b->end;
barrier = NEXT_INSN (b->end);
/* Recognize a jump table following block B. */
@@ -331,6 +332,8 @@ merge_blocks_move_successor_nojumps (a, b)
&& (GET_CODE (PATTERN (NEXT_INSN (barrier))) == ADDR_VEC
|| GET_CODE (PATTERN (NEXT_INSN (barrier))) == ADDR_DIFF_VEC))
{
+ /* Temporarily add the table jump insn to b, so that it will also
+ be moved to the correct location. */
b->end = NEXT_INSN (barrier);
barrier = NEXT_INSN (b->end);
}
@@ -351,6 +354,9 @@ merge_blocks_move_successor_nojumps (a, b)
/* Scramble the insn chain. */
reorder_insns_nobb (b->head, b->end, a->end);
+ /* Restore the real end of b. */
+ b->end = real_b_end;
+
/* Now blocks A and B are contiguous. Merge them. */
merge_blocks_nomove (a, b);