summaryrefslogtreecommitdiff
path: root/gcc/cfgrtl.c
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2002-02-04 16:03:14 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2002-02-04 16:03:14 +0000
commit869fe49e07b87b5ebce6fd948868590d81924f60 (patch)
treee8df6f9cdd391074172099255b71b5000ca7ade6 /gcc/cfgrtl.c
parent1ff4e7e1b21a19deece7f5a48e94f207df647363 (diff)
downloadgcc-869fe49e07b87b5ebce6fd948868590d81924f60.tar.gz
* cfgrtl.c (try_redirect_by_replacing_jump): Remove associated
CODE_LABEL and jump table when replacing a table jump with a simple jump. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49478 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgrtl.c')
-rw-r--r--gcc/cfgrtl.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
index f3187989add..9e8269b8479 100644
--- a/gcc/cfgrtl.c
+++ b/gcc/cfgrtl.c
@@ -714,7 +714,7 @@ try_redirect_by_replacing_jump (e, target)
else
{
rtx target_label = block_label (target);
- rtx barrier;
+ rtx barrier, tmp;
emit_jump_insn_after (gen_jump (target_label), insn);
JUMP_LABEL (src->end) = target_label;
@@ -723,8 +723,21 @@ try_redirect_by_replacing_jump (e, target)
fprintf (rtl_dump_file, "Replacing insn %i by jump %i\n",
INSN_UID (insn), INSN_UID (src->end));
+
delete_insn_chain (kill_from, insn);
+ /* Recognize a tablejump that we are converting to a
+ simple jump and remove its associated CODE_LABEL
+ and ADDR_VEC or ADDR_DIFF_VEC. */
+ if ((tmp = JUMP_LABEL (insn)) != NULL_RTX
+ && (tmp = NEXT_INSN (tmp)) != NULL_RTX
+ && GET_CODE (tmp) == JUMP_INSN
+ && (GET_CODE (PATTERN (tmp)) == ADDR_VEC
+ || GET_CODE (PATTERN (tmp)) == ADDR_DIFF_VEC))
+ {
+ delete_insn_chain (JUMP_LABEL (insn), tmp);
+ }
+
barrier = next_nonnote_insn (src->end);
if (!barrier || GET_CODE (barrier) != BARRIER)
emit_barrier_after (src->end);