aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1997-07-13 15:11:06 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1997-07-13 15:11:06 -0400
commit79d06d29adcb59b8e0e1a36f3d3ccfaff10bee47 (patch)
tree9d5b3e6fcc8578c427f5a7c73f6e2696027adb40
parenta23ea59844cf672a4bc1a57ee0f47f9c75fe7a0c (diff)
downloadgcc-79d06d29adcb59b8e0e1a36f3d3ccfaff10bee47.zip
gcc-79d06d29adcb59b8e0e1a36f3d3ccfaff10bee47.tar.gz
gcc-79d06d29adcb59b8e0e1a36f3d3ccfaff10bee47.tar.bz2
(stupid_mark_refs): If setting reg set only in this insn and not
referenced, make REG_UNUSED note. From-SVN: r14416
-rw-r--r--gcc/stupid.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/gcc/stupid.c b/gcc/stupid.c
index 396799e..9a18e55 100644
--- a/gcc/stupid.c
+++ b/gcc/stupid.c
@@ -1,5 +1,5 @@
/* Dummy data flow analysis for GNU compiler in nonoptimizing mode.
- Copyright (C) 1987, 1991, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1987, 91, 94, 95, 96, 1997 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -514,6 +514,19 @@ stupid_mark_refs (x, insn)
if (last_setjmp_suid < reg_where_dead[regno])
regs_crosses_setjmp[regno] = 1;
+
+ /* If this register is only used in this insn and is only
+ set, mark it unused. We have to do this even when not
+ optimizing so that MD patterns which count on this
+ behavior (e.g., it not causing an output reload on
+ an insn setting CC) will operate correctly. */
+ if (GET_CODE (SET_DEST (x)) == REG
+ &&& REGNO_FIRST_UID (regno) == INSN_UID (insn)
+ && REGNO_LAST_UID (regno) == INSN_UID (insn)
+ && (code == CLOBBER || ! reg_mentioned_p (SET_DEST (x),
+ SET_SRC (x))))
+ REG_NOTES (insn) = gen_rtx (EXPR_LIST, REG_UNUSED,
+ SET_DEST (x), REG_NOTES (insn));
}
}