aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1994-03-11 08:29:36 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1994-03-11 08:29:36 -0500
commit484c39243085f21d504251d9f56d5685b73f40fd (patch)
tree98bfa7e196cd47ea775b341eb2d86294694a6c36 /gcc
parentd18225c493c9d677f1fb27a611c47ea8ba276d99 (diff)
downloadgcc-484c39243085f21d504251d9f56d5685b73f40fd.zip
gcc-484c39243085f21d504251d9f56d5685b73f40fd.tar.gz
gcc-484c39243085f21d504251d9f56d5685b73f40fd.tar.bz2
(jump_optimize): Delete REG_LABEL note if label no longer in insn.
From-SVN: r6745
Diffstat (limited to 'gcc')
-rw-r--r--gcc/jump.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/gcc/jump.c b/gcc/jump.c
index 1129b6d..a69ca79 100644
--- a/gcc/jump.c
+++ b/gcc/jump.c
@@ -143,7 +143,7 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
int noop_moves;
int after_regscan;
{
- register rtx insn, next;
+ register rtx insn, next, note;
int changed;
int first = 1;
int max_uid = 0;
@@ -151,7 +151,8 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
cross_jump_death_matters = (cross_jump == 2);
- /* Initialize LABEL_NUSES and JUMP_LABEL fields. */
+ /* Initialize LABEL_NUSES and JUMP_LABEL fields. Delete any REG_LABEL
+ notes whose labels don't occur in the insn any more. */
for (insn = f; insn; insn = NEXT_INSN (insn))
{
@@ -159,6 +160,15 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
LABEL_NUSES (insn) = (LABEL_PRESERVE_P (insn) != 0);
else if (GET_CODE (insn) == JUMP_INSN)
JUMP_LABEL (insn) = 0;
+ else if (GET_CODE (insn) == INSN || GET_CODE (insn) == CALL_INSN)
+ for (note = REG_NOTES (insn); note; note = next)
+ {
+ next = XEXP (note, 1);
+ if (REG_NOTE_KIND (note) == REG_LABEL
+ && ! reg_mentioned_p (XEXP (note, 0), PATTERN (insn)))
+ remove_note (insn, note);
+ }
+
if (INSN_UID (insn) > max_uid)
max_uid = INSN_UID (insn);
}