aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1992-12-27 19:53:28 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1992-12-27 19:53:28 -0500
commit3e5478ea210d0c71b2c0e695f4fd0e5e183a9b7a (patch)
tree34b052177fc9568800d79d36dc4514161ab81659 /gcc
parent9fca773d22ce7679d9f683210a36ae5e520cb311 (diff)
downloadgcc-3e5478ea210d0c71b2c0e695f4fd0e5e183a9b7a.zip
gcc-3e5478ea210d0c71b2c0e695f4fd0e5e183a9b7a.tar.gz
gcc-3e5478ea210d0c71b2c0e695f4fd0e5e183a9b7a.tar.bz2
(delete_jump): Use single_set to see if INSN just sets PC.
Remove code to delete previous cc0-setting insn. (delete_compution): No longer conditional on #ifndef HAVE_cc0. If insn uses CC0, delete previous insn that just sets CC0 for us; do deletion via recursive call. From-SVN: r2936
Diffstat (limited to 'gcc')
-rw-r--r--gcc/jump.c56
1 files changed, 29 insertions, 27 deletions
diff --git a/gcc/jump.c b/gcc/jump.c
index 5ed2828..5ba9344 100644
--- a/gcc/jump.c
+++ b/gcc/jump.c
@@ -3041,12 +3041,34 @@ void
delete_jump (insn)
rtx insn;
{
- register rtx x = PATTERN (insn);
+ register rtx set = single_set (insn);
+
+ if (set && GET_CODE (SET_DEST (set)) == PC)
+ delete_computation (insn);
+}
+
+/* Delete INSN and recursively delete insns that compute values used only
+ by INSN. This uses the REG_DEAD notes computed during flow analysis.
+ If we are running before flow.c, we need do nothing since flow.c will
+ delete dead code. We also can't know if the registers being used are
+ dead or not at this point.
+
+ Otherwise, look at all our REG_DEAD notes. If a previous insn does
+ nothing other than set a register that dies in this insn, we can delete
+ that insn as well.
+
+ On machines with CC0, if CC0 is used in this insn, we may be able to
+ delete the insn that set it. */
+
+void
+delete_computation (insn)
+ rtx insn;
+{
+ rtx note, next;
- if (GET_CODE (x) == SET
- && GET_CODE (SET_DEST (x)) == PC)
- {
#ifdef HAVE_cc0
+ if (reg_referenced_p (cc0_rtx, insn))
+ {
rtx prev = prev_nonnote_insn (insn);
/* We assume that at this stage
CC's are always set explicitly
@@ -3059,34 +3081,14 @@ delete_jump (insn)
{
if (sets_cc0_p (PATTERN (prev)) > 0
&& !FIND_REG_INC_NOTE (prev, NULL_RTX))
- delete_insn (prev);
+ delete_computation (prev);
else
/* Otherwise, show that cc0 won't be used. */
REG_NOTES (prev) = gen_rtx (EXPR_LIST, REG_UNUSED,
cc0_rtx, REG_NOTES (prev));
}
-#endif
- /* Now delete the jump insn itself. */
- delete_computation (insn);
}
-}
-
-/* Delete INSN and recursively delete insns that compute values used only
- by INSN. This uses the REG_DEAD notes computed during flow analysis.
- If we are running before flow.c, we need do nothing since flow.c will
- delete dead code. We also can't know if the registers being used are
- dead or not at this point.
-
- Otherwise, look at all our REG_DEAD notes. If a previous insn does
- nothing other than set a register that dies in this insn, we can delete
- that insn as well. */
-
-void
-delete_computation (insn)
- rtx insn;
-{
-#ifndef HAVE_cc0
- rtx note, next;
+#endif
for (note = REG_NOTES (insn); note; note = next)
{
@@ -3157,7 +3159,7 @@ delete_computation (insn)
}
}
}
-#endif /* Don't HAVE_cc0 */
+
delete_insn (insn);
}