summaryrefslogtreecommitdiff
path: root/gcc/loop.c
diff options
context:
space:
mode:
authorJohn David Anglin <dave@hiauly1.hia.nrc.ca>2001-01-02 00:58:27 +0000
committerJeff Law <law@gcc.gnu.org>2001-01-01 17:58:27 -0700
commit5b1ef594574c48fc88045d143efe913f704e3f09 (patch)
treec12363c0e9a70d4af1ff930ffa68b983b514f4e9 /gcc/loop.c
parent5be1aac9125764200d1c8a430cb8e580998c96d2 (diff)
downloadgcc-5b1ef594574c48fc88045d143efe913f704e3f09.tar.gz
loop.c (add_label_notes): Increment the label usage count when a note is added to an insn which refers to...
* loop.c (add_label_notes): Increment the label usage count when a note is added to an insn which refers to a CODE_LABEL. * gcse.c (add_label_notes): Likewise. From-SVN: r38603
Diffstat (limited to 'gcc/loop.c')
-rw-r--r--gcc/loop.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/gcc/loop.c b/gcc/loop.c
index 8faacaf3e02..a504ed65c88 100644
--- a/gcc/loop.c
+++ b/gcc/loop.c
@@ -1594,7 +1594,8 @@ rtx_equal_for_loop_p (x, y, movables, regs)
}
/* If X contains any LABEL_REF's, add REG_LABEL notes for them to all
- insns in INSNS which use the reference. */
+ insns in INSNS which use the reference. LABEL_NUSES for CODE_LABEL
+ references is incremented once for each added note. */
static void
add_label_notes (x, insns)
@@ -1615,8 +1616,12 @@ add_label_notes (x, insns)
mark_jump_label for additional information). */
for (insn = insns; insn; insn = NEXT_INSN (insn))
if (reg_mentioned_p (XEXP (x, 0), insn))
- REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_LABEL, XEXP (x, 0),
- REG_NOTES (insn));
+ {
+ REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_LABEL, XEXP (x, 0),
+ REG_NOTES (insn));
+ if (LABEL_P (XEXP (x, 0)))
+ LABEL_NUSES (XEXP (x, 0))++;
+ }
}
fmt = GET_RTX_FORMAT (code);