summaryrefslogtreecommitdiff
path: root/gcc/jump.c
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2001-04-28 16:53:00 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2001-04-28 16:53:00 +0000
commit6153f5f091eb6d94816fc1b84a63763c438f8717 (patch)
tree875f2d598870b2626ddc81d482220efa9067a49c /gcc/jump.c
parentfdeff8907c5725010a841067c2462950841f63ba (diff)
downloadgcc-6153f5f091eb6d94816fc1b84a63763c438f8717.tar.gz
* flow.c (propagate_block_delete_insn): Handle deletion of ADDR_VEC
and ADDR_DIFF_VEC insns when the proceeding CODE_LABEL was put into the constant pool. * jump.c (jump_optimize_1): Remove barrier successors after all the LABEL_NUSES counds have been computed. (delete_barrier_successors): When deleting a tablejump insn, also delete the jump table it uses. * varasm.c (force_const_mem): Set LABEL_PRESERVE_P when forcing a label into memory. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@41662 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/jump.c')
-rw-r--r--gcc/jump.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/gcc/jump.c b/gcc/jump.c
index e3ed1b42747..4046b9a350d 100644
--- a/gcc/jump.c
+++ b/gcc/jump.c
@@ -214,9 +214,6 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan,
cross_jump_death_matters = (cross_jump == 2);
max_uid = init_label_info (f) + 1;
- if (! mark_labels_only)
- delete_barrier_successors (f);
-
/* Leave some extra room for labels and duplicate exit test insns
we make. */
max_jump_chain = max_uid * 14 / 10;
@@ -239,6 +236,9 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan,
if (GET_CODE (XEXP (insn, 0)) == CODE_LABEL)
LABEL_NUSES (XEXP (insn, 0))++;
+ if (! mark_labels_only)
+ delete_barrier_successors (f);
+
/* Quit now if we just wanted to rebuild the JUMP_LABEL and REG_LABEL
notes and recompute LABEL_NUSES. */
if (mark_labels_only)
@@ -792,7 +792,24 @@ delete_barrier_successors (f)
while (insn != 0 && GET_CODE (insn) != CODE_LABEL)
{
- if (GET_CODE (insn) == NOTE
+ if (GET_CODE (insn) == JUMP_INSN)
+ {
+ /* Detect when we're deleting a tablejump; get rid of
+ the jump table as well. */
+ rtx next1 = next_nonnote_insn (insn);
+ rtx next2 = next1 ? next_nonnote_insn (next1) : 0;
+ if (next2 && GET_CODE (next1) == CODE_LABEL
+ && GET_CODE (next2) == JUMP_INSN
+ && (GET_CODE (PATTERN (next2)) == ADDR_VEC
+ || GET_CODE (PATTERN (next2)) == ADDR_DIFF_VEC))
+ {
+ delete_insn (insn);
+ insn = next2;
+ }
+ else
+ insn = delete_insn (insn);
+ }
+ else if (GET_CODE (insn) == NOTE
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_FUNCTION_END)
insn = NEXT_INSN (insn);
else