aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1994-02-26 16:12:46 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1994-02-26 16:12:46 -0500
commit63770d6ae3acabd6aa3542993afefd37c4ccfd8f (patch)
tree138e34ad8c6b4ecf5b34eeacdb450d57fbb1b5e6
parent9ff08f70f3b2ab1b68c1e7934ede369ae0417c4f (diff)
downloadgcc-63770d6ae3acabd6aa3542993afefd37c4ccfd8f.zip
gcc-63770d6ae3acabd6aa3542993afefd37c4ccfd8f.tar.gz
gcc-63770d6ae3acabd6aa3542993afefd37c4ccfd8f.tar.bz2
(fixup_var_refs_insn): Delete CLOBBER of VAR.
(fixup_var_refs_insn): Delete CLOBBER of VAR. If VAR is being assigned into by a libcall sequence, remove the libcall notes. From-SVN: r6632
-rw-r--r--gcc/function.c36
1 files changed, 29 insertions, 7 deletions
diff --git a/gcc/function.c b/gcc/function.c
index 361bbf8..a66e336 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -1307,15 +1307,37 @@ fixup_var_refs_insns (var, promoted_mode, unsignedp, insn, toplevel)
rtx note;
if (GET_RTX_CLASS (GET_CODE (insn)) == 'i')
{
+ /* If this is a CLOBBER of VAR, delete it.
+
+ If it has a REG_LIBCALL note, delete the REG_LIBCALL
+ and REG_RETVAL notes too. */
+ if (GET_CODE (PATTERN (insn)) == CLOBBER
+ && XEXP (PATTERN (insn), 0) == var)
+ {
+ if ((note = find_reg_note (insn, REG_LIBCALL, NULL_RTX)) != 0)
+ /* The REG_LIBCALL note will go away since we are going to
+ turn INSN into a NOTE, so just delete the
+ corresponding REG_RETVAL note. */
+ remove_note (XEXP (note, 0),
+ find_reg_note (XEXP (note, 0), REG_RETVAL,
+ NULL_RTX));
+
+ /* In unoptimized compilation, we shouldn't call delete_insn
+ except in jump.c doing warnings. */
+ PUT_CODE (insn, NOTE);
+ NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
+ NOTE_SOURCE_FILE (insn) = 0;
+ }
+
/* The insn to load VAR from a home in the arglist
is now a no-op. When we see it, just delete it. */
- if (toplevel
- && GET_CODE (PATTERN (insn)) == SET
- && SET_DEST (PATTERN (insn)) == var
- /* If this represents the result of an insn group,
- don't delete the insn. */
- && find_reg_note (insn, REG_RETVAL, NULL_RTX) == 0
- && rtx_equal_p (SET_SRC (PATTERN (insn)), var))
+ else if (toplevel
+ && GET_CODE (PATTERN (insn)) == SET
+ && SET_DEST (PATTERN (insn)) == var
+ /* If this represents the result of an insn group,
+ don't delete the insn. */
+ && find_reg_note (insn, REG_RETVAL, NULL_RTX) == 0
+ && rtx_equal_p (SET_SRC (PATTERN (insn)), var))
{
/* In unoptimized compilation, we shouldn't call delete_insn
except in jump.c doing warnings. */