From 5c5e36c5446aaa7a3ead6385a100ad76bf2a42a8 Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Fri, 11 Feb 1994 20:00:44 -0500 Subject: [PATCH] (mark_jump_label, case LABEL_REF): Update REG_LABEL note if changing target of jump. From-SVN: r6533 --- gcc/jump.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/gcc/jump.c b/gcc/jump.c index a55c951..b8f08eb 100644 --- a/gcc/jump.c +++ b/gcc/jump.c @@ -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); -- 2.7.4