diff options
author | zlomek <zlomek@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-07-21 17:18:00 +0000 |
---|---|---|
committer | zlomek <zlomek@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-07-21 17:18:00 +0000 |
commit | afff715a2b85e18e40520b04b5b44cf0623a03a0 (patch) | |
tree | bcd516494e3a3a432b0f74413525c76618b44685 /gcc/cfgcleanup.c | |
parent | 35cd7b2977ae15970bc6cd083216b33ea837060c (diff) | |
download | gcc-afff715a2b85e18e40520b04b5b44cf0623a03a0.tar.gz |
* cfgcleanup.c (merge_blocks_move_successor_nojumps): Use tablejump_p.
* rtlanal.c (tablejump_p): Use next_active_insn for finding the jump
table.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@69637 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgcleanup.c')
-rw-r--r-- | gcc/cfgcleanup.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c index 7dbed9b9705..d03a16d88f9 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); |