+1998-01-28 Mike Stump <mrs@wrs.com>
+
+ * rtlanal.c (dead_or_set_regno_p): Ignore REG_DEAD notes after
+ reload completes.
+ * genattrtab.c (reload_completed): Define.
+
+ * m32r.md, mips.md, mn10200.md, mn10300.md, pyr.md: Remove obsolete
+ comments.
+
Wed Jan 28 20:11:06 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
* reload.c (push_reload): If WORD_REGISTER_OPERATIONS, reload the
{
/* Try to use auto-inc addressing if we can. */
if (GET_CODE (XEXP (operands[1], 0)) == REG
- /* ??? This is WRONG, dead_or_set_p cannot be used after reload
- because the REG_DEAD notes are not maintained after reload. */
&& dead_or_set_p (insn, XEXP (operands[1], 0)))
{
operands[1] = XEXP (operands[1], 0);
case 3 :
/* Try to use auto-inc addressing if we can. */
if (GET_CODE (XEXP (operands[0], 0)) == REG
- /* ??? This is WRONG, dead_or_set_p cannot be used after reload
- because the REG_DEAD notes are not maintained after reload. */
&& dead_or_set_p (insn, XEXP (operands[0], 0)))
{
operands[0] = XEXP (operands[0], 0);
{
/* Try to use auto-inc addressing if we can. */
if (GET_CODE (XEXP (operands[1], 0)) == REG
- /* ??? This is WRONG, dead_or_set_p cannot be used after reload
- because the REG_DEAD notes are not maintained after reload. */
&& dead_or_set_p (insn, XEXP (operands[1], 0)))
{
operands[1] = XEXP (operands[1], 0);
case 3 :
/* Try to use auto-inc addressing if we can. */
if (GET_CODE (XEXP (operands[0], 0)) == REG
- /* ??? This is WRONG, dead_or_set_p cannot be used after reload
- because the REG_DEAD notes are not maintained after reload. */
&& dead_or_set_p (insn, XEXP (operands[0], 0)))
{
operands[0] = XEXP (operands[0], 0);
[(set (mem:SI (plus:SI (match_operand:SI 0 "register_operand" "r")
(const_int 4)))
(match_operand:SI 1 "register_operand" "r"))]
-;; ??? This is WRONG, dead_or_set_p cannot be used after reload
-;; because the REG_DEAD notes are not maintained after reload.
"dead_or_set_p (insn, operands[0])"
"st %1,@+%0"
[(set_attr "type" "store")
"TARGET_MIPS16
&& GET_CODE (operands[0]) == REG
&& REGNO (operands[0]) == 24
-;; ??? This is WRONG, dead_or_set_p cannot be used after reload
-;; because the REG_DEAD notes are not maintained after reload.
&& dead_or_set_p (insn, operands[0])
&& GET_CODE (operands[1]) == REG
&& M16_REG_P (REGNO (operands[1]))"
"TARGET_MIPS16 && TARGET_64BIT
&& GET_CODE (operands[0]) == REG
&& REGNO (operands[0]) == 24
-;; ??? This is WRONG, dead_or_set_p cannot be used after reload
-;; because the REG_DEAD notes are not maintained after reload.
&& dead_or_set_p (insn, operands[0])
&& GET_CODE (operands[1]) == REG
&& M16_REG_P (REGNO (operands[1]))"
&& REGNO (operands[1]) == 24
&& GET_CODE (operands[0]) == REG
&& M16_REG_P (REGNO (operands[0]))
-;; ??? This is WRONG, dead_or_set_p cannot be used after reload
-;; because the REG_DEAD notes are not maintained after reload.
&& dead_or_set_p (insn, operands[0])"
"*
{
&& REGNO (operands[1]) == 24
&& GET_CODE (operands[0]) == REG
&& M16_REG_P (REGNO (operands[0]))
-;; ??? This is WRONG, dead_or_set_p cannot be used after reload
-;; because the REG_DEAD notes are not maintained after reload.
&& dead_or_set_p (insn, operands[0])"
"*
{
(set (pc) (if_then_else (ge (cc0) (const_int 0))
(match_operand 1 "" "")
(pc)))]
-;; ??? This is WRONG, dead_or_set_p cannot be used after reload
-;; because the REG_DEAD notes are not maintained after reload.
"dead_or_set_p (ins1, operands[0]) && REG_OK_FOR_INDEX_P (operands[0])"
"add %0,%0\;bcc %1"
[(set_attr "cc" "clobber")])
(set (pc) (if_then_else (lt (cc0) (const_int 0))
(match_operand 1 "" "")
(pc)))]
-;; ??? This is WRONG, dead_or_set_p cannot be used after reload
-;; because the REG_DEAD notes are not maintained after reload.
"dead_or_set_p (ins1, operands[0]) && REG_OK_FOR_INDEX_P (operands[0])"
"add %0,%0\;bcs %1"
[(set_attr "cc" "clobber")])
(set (pc) (if_then_else (ge (cc0) (const_int 0))
(pc)
(match_operand 1 "" "")))]
-;; ??? This is WRONG, dead_or_set_p cannot be used after reload
-;; because the REG_DEAD notes are not maintained after reload.
"dead_or_set_p (ins1, operands[0]) && REG_OK_FOR_INDEX_P (operands[0])"
"add %0,%0\;bcs %1"
[(set_attr "cc" "clobber")])
(set (pc) (if_then_else (lt (cc0) (const_int 0))
(pc)
(match_operand 1 "" "")))]
-;; ??? This is WRONG, dead_or_set_p cannot be used after reload
-;; because the REG_DEAD notes are not maintained after reload.
"dead_or_set_p (ins1, operands[0]) && REG_OK_FOR_INDEX_P (operands[0])"
"add %0,%0\;bcc %1"
[(set_attr "cc" "clobber")])
(set (pc) (if_then_else (ge (cc0) (const_int 0))
(match_operand 1 "" "")
(pc)))]
-;; ??? This is WRONG, dead_or_set_p cannot be used after reload
-;; because the REG_DEAD notes are not maintained after reload.
"dead_or_set_p (ins1, operands[0]) && REG_OK_FOR_INDEX_P (operands[0])"
"add %0,%0\;bccx %1"
[(set_attr "cc" "clobber")])
(set (pc) (if_then_else (lt (cc0) (const_int 0))
(match_operand 1 "" "")
(pc)))]
-;; ??? This is WRONG, dead_or_set_p cannot be used after reload
-;; because the REG_DEAD notes are not maintained after reload.
"dead_or_set_p (ins1, operands[0]) && REG_OK_FOR_INDEX_P (operands[0])"
"add %0,%0\;bcsx %1"
[(set_attr "cc" "clobber")])
(set (pc) (if_then_else (ge (cc0) (const_int 0))
(pc)
(match_operand 1 "" "")))]
-;; ??? This is WRONG, dead_or_set_p cannot be used after reload
-;; because the REG_DEAD notes are not maintained after reload.
"dead_or_set_p (ins1, operands[0]) && REG_OK_FOR_INDEX_P (operands[0])"
"add %0,%0\;bcsx %1"
[(set_attr "cc" "clobber")])
(set (pc) (if_then_else (lt (cc0) (const_int 0))
(pc)
(match_operand 1 "" "")))]
-;; ??? This is WRONG, dead_or_set_p cannot be used after reload
-;; because the REG_DEAD notes are not maintained after reload.
"dead_or_set_p (ins1, operands[0]) && REG_OK_FOR_INDEX_P (operands[0])"
"add %0,%0\;bccx %1"
[(set_attr "cc" "clobber")])
(set (pc) (if_then_else (ge (cc0) (const_int 0))
(match_operand 1 "" "")
(pc)))]
-;; ??? This is WRONG, dead_or_set_p cannot be used after reload
-;; because the REG_DEAD notes are not maintained after reload.
"dead_or_set_p (ins1, operands[0]) && REG_OK_FOR_INDEX_P (operands[0])"
"add %0,%0\;bcc %1"
[(set_attr "cc" "clobber")])
(set (pc) (if_then_else (lt (cc0) (const_int 0))
(match_operand 1 "" "")
(pc)))]
-;; ??? This is WRONG, dead_or_set_p cannot be used after reload
-;; because the REG_DEAD notes are not maintained after reload.
"dead_or_set_p (ins1, operands[0]) && REG_OK_FOR_INDEX_P (operands[0])"
"add %0,%0\;bcs %1"
[(set_attr "cc" "clobber")])
(set (pc) (if_then_else (ge (cc0) (const_int 0))
(pc)
(match_operand 1 "" "")))]
-;; ??? This is WRONG, dead_or_set_p cannot be used after reload
-;; because the REG_DEAD notes are not maintained after reload.
"dead_or_set_p (ins1, operands[0]) && REG_OK_FOR_INDEX_P (operands[0])"
"add %0,%0\;bcs %1"
[(set_attr "cc" "clobber")])
(set (pc) (if_then_else (lt (cc0) (const_int 0))
(pc)
(match_operand 1 "" "")))]
-;; ??? This is WRONG, dead_or_set_p cannot be used after reload
-;; because the REG_DEAD notes are not maintained after reload.
"dead_or_set_p (ins1, operands[0]) && REG_OK_FOR_INDEX_P (operands[0])"
"add %0,%0\;bcc %1"
[(set_attr "cc" "clobber")])
(sign_extend:SI (match_dup 1)))
(set (cc0)
(match_dup 2))]
-;; ??? This is WRONG, dead_or_set_p cannot be used after reload
-;; because the REG_DEAD notes are not maintained after reload.
"dead_or_set_p (insn, operands[2])"
"*
cc_status.flags |= CC_NO_OVERFLOW;
static char *alternative_name;
+/* Indicate that REG_DEAD notes are valid if dead_or_set_p is ever
+ called. */
+
+int reload_completed = 0;
+
/* Simplify an expression. Only call the routine if there is something to
simplify. */
#define SIMPLIFY_TEST_EXP(EXP,INSN_CODE,INSN_INDEX) \
int regno, endregno;
rtx link;
- /* See if there is a death note for something that includes TEST_REGNO. */
- for (link = REG_NOTES (insn); link; link = XEXP (link, 1))
+ /* REG_READ notes are not normally maintained after reload, so we
+ ignore them if the are invalid. */
+ if (! reload_completed
+#ifdef PRESERVE_DEATH_INFO_REGNO_P
+ || PRESERVE_DEATH_INFO_REGNO_P (test_regno)
+#endif
+ )
{
- if (REG_NOTE_KIND (link) != REG_DEAD || GET_CODE (XEXP (link, 0)) != REG)
- continue;
+ /* See if there is a death note for something that includes
+ TEST_REGNO. */
+ for (link = REG_NOTES (insn); link; link = XEXP (link, 1))
+ {
+ if (REG_NOTE_KIND (link) != REG_DEAD
+ || GET_CODE (XEXP (link, 0)) != REG)
+ continue;
- regno = REGNO (XEXP (link, 0));
- endregno = (regno >= FIRST_PSEUDO_REGISTER ? regno + 1
- : regno + HARD_REGNO_NREGS (regno,
- GET_MODE (XEXP (link, 0))));
+ regno = REGNO (XEXP (link, 0));
+ endregno = (regno >= FIRST_PSEUDO_REGISTER ? regno + 1
+ : regno + HARD_REGNO_NREGS (regno,
+ GET_MODE (XEXP (link, 0))));
- if (test_regno >= regno && test_regno < endregno)
- return 1;
+ if (test_regno >= regno && test_regno < endregno)
+ return 1;
+ }
}
if (GET_CODE (insn) == CALL_INSN