From 63770d6ae3acabd6aa3542993afefd37c4ccfd8f Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Sat, 26 Feb 1994 16:12:46 -0500 Subject: [PATCH] (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 --- gcc/function.c | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/gcc/function.c b/gcc/function.c index 361bbf86e14..a66e3367831 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. */ -- 2.30.2