aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgcleanup.c
diff options
context:
space:
mode:
authorJosef Zlomek <zlomekj@suse.cz>2003-07-21 19:18:00 +0200
committerJosef Zlomek <zlomek@gcc.gnu.org>2003-07-21 17:18:00 +0000
commitee735eefd8a7c7dd2b22d85e737c802291489a39 (patch)
treebcd516494e3a3a432b0f74413525c76618b44685 /gcc/cfgcleanup.c
parentf345c6b5225e3d4d64686f8b045c4a7bbf016cf0 (diff)
downloadgcc-ee735eefd8a7c7dd2b22d85e737c802291489a39.zip
gcc-ee735eefd8a7c7dd2b22d85e737c802291489a39.tar.gz
gcc-ee735eefd8a7c7dd2b22d85e737c802291489a39.tar.bz2
cfgcleanup.c (merge_blocks_move_successor_nojumps): Use tablejump_p.
* cfgcleanup.c (merge_blocks_move_successor_nojumps): Use tablejump_p. * rtlanal.c (tablejump_p): Use next_active_insn for finding the jump table. From-SVN: r69637
Diffstat (limited to 'gcc/cfgcleanup.c')
-rw-r--r--gcc/cfgcleanup.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c
index 7dbed9b..d03a16d 100644
--- a/gcc/cfgcleanup.c
+++ b/gcc/cfgcleanup.c
@@ -714,25 +714,20 @@ static void
merge_blocks_move_successor_nojumps (basic_block a, basic_block b)
{
rtx barrier, real_b_end;
+ rtx label, table;
real_b_end = b->end;
- barrier = NEXT_INSN (b->end);
- /* Recognize a jump table following block B. */
- if (barrier
- && GET_CODE (barrier) == CODE_LABEL
- && NEXT_INSN (barrier)
- && GET_CODE (NEXT_INSN (barrier)) == JUMP_INSN
- && (GET_CODE (PATTERN (NEXT_INSN (barrier))) == ADDR_VEC
- || GET_CODE (PATTERN (NEXT_INSN (barrier))) == ADDR_DIFF_VEC))
+ /* If there is a jump table following block B temporarily add the jump table
+ to block B so that it will also be moved to the correct location. */
+ if (tablejump_p (b->end, &label, &table)
+ && prev_active_insn (label) == b->end)
{
- /* 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);
+ b->end = table;
}
/* There had better have been a barrier there. Delete it. */
+ barrier = NEXT_INSN (b->end);
if (barrier && GET_CODE (barrier) == BARRIER)
delete_insn (barrier);