diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1994-02-11 20:00:44 -0500 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1994-02-11 20:00:44 -0500 |
commit | 5c5e36c5446aaa7a3ead6385a100ad76bf2a42a8 (patch) | |
tree | cde817496b16f68214450da9f722c06c5cb3e408 | |
parent | b67b29cd338c3da3e34c22c5114c173a70c528c2 (diff) | |
download | gcc-5c5e36c5446aaa7a3ead6385a100ad76bf2a42a8.zip gcc-5c5e36c5446aaa7a3ead6385a100ad76bf2a42a8.tar.gz gcc-5c5e36c5446aaa7a3ead6385a100ad76bf2a42a8.tar.bz2 |
(mark_jump_label, case LABEL_REF): Update REG_LABEL note if changing
target of jump.
From-SVN: r6533
-rw-r--r-- | gcc/jump.c | 20 |
1 files changed, 18 insertions, 2 deletions
@@ -3014,13 +3014,18 @@ mark_jump_label (x, insn, cross_jump) case LABEL_REF: { - register rtx label = XEXP (x, 0); - register rtx next; + rtx label = XEXP (x, 0); + rtx olabel = label; + rtx note; + rtx next; + if (GET_CODE (label) != CODE_LABEL) abort (); + /* Ignore references to labels of containing functions. */ if (LABEL_REF_NONLOCAL_P (x)) break; + /* If there are other labels following this one, replace it with the last of the consecutive labels. */ for (next = NEXT_INSN (label); next; next = NEXT_INSN (next)) @@ -3038,12 +3043,23 @@ mark_jump_label (x, insn, cross_jump) || NOTE_LINE_NUMBER (next) == NOTE_INSN_FUNCTION_END)) break; } + XEXP (x, 0) = label; ++LABEL_NUSES (label); + if (insn) { if (GET_CODE (insn) == JUMP_INSN) JUMP_LABEL (insn) = label; + + /* If we've changed OLABEL and we had a REG_LABEL note + for it, update it as well. */ + else if (label != olabel + && (note = find_reg_note (insn, REG_LABEL, olabel)) != 0) + XEXP (note, 0) = label; + + /* Otherwise, add a REG_LABEL note for LABEL unless there already + is one. */ else if (! find_reg_note (insn, REG_LABEL, label)) { rtx next = next_real_insn (label); |