From 21ca87b81b0961895d21faae45fa2e25d59f7dc0 Mon Sep 17 00:00:00 2001 From: Mike Stump Date: Wed, 28 Jan 1998 19:21:54 +0000 Subject: [PATCH] rtlanal.c (dead_or_set_regno_p): Ignore REG_DEAD notes after reload completes. * 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. From-SVN: r17542 --- gcc/ChangeLog | 9 +++++++++ gcc/config/m32r/m32r.md | 10 ---------- gcc/config/mips/mips.md | 8 -------- gcc/config/mn10200/mn10200.md | 16 ---------------- gcc/config/mn10300/mn10300.md | 8 -------- gcc/config/pyr/pyr.md | 2 -- gcc/genattrtab.c | 5 +++++ gcc/rtlanal.c | 31 +++++++++++++++++++++---------- 8 files changed, 35 insertions(+), 54 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c84c110820c..141302c07df 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +1998-01-28 Mike Stump + + * 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 * reload.c (push_reload): If WORD_REGISTER_OPERATIONS, reload the diff --git a/gcc/config/m32r/m32r.md b/gcc/config/m32r/m32r.md index 5e40acd3a54..4c8b2e54ffb 100644 --- a/gcc/config/m32r/m32r.md +++ b/gcc/config/m32r/m32r.md @@ -379,8 +379,6 @@ { /* 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); @@ -391,8 +389,6 @@ 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); @@ -534,8 +530,6 @@ { /* 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); @@ -546,8 +540,6 @@ 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); @@ -1471,8 +1463,6 @@ [(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") diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md index 948c7334ebb..f90d75b50fd 100644 --- a/gcc/config/mips/mips.md +++ b/gcc/config/mips/mips.md @@ -9771,8 +9771,6 @@ move\\t%0,%z4\\n\\ "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]))" @@ -9798,8 +9796,6 @@ move\\t%0,%z4\\n\\ "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]))" @@ -9831,8 +9827,6 @@ move\\t%0,%z4\\n\\ && 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])" "* { @@ -9858,8 +9852,6 @@ move\\t%0,%z4\\n\\ && 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])" "* { diff --git a/gcc/config/mn10200/mn10200.md b/gcc/config/mn10200/mn10200.md index 47528aedb53..90f7f808753 100644 --- a/gcc/config/mn10200/mn10200.md +++ b/gcc/config/mn10200/mn10200.md @@ -1888,8 +1888,6 @@ (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")]) @@ -1899,8 +1897,6 @@ (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")]) @@ -1910,8 +1906,6 @@ (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")]) @@ -1921,8 +1915,6 @@ (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")]) @@ -1932,8 +1924,6 @@ (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")]) @@ -1943,8 +1933,6 @@ (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")]) @@ -1954,8 +1942,6 @@ (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")]) @@ -1965,8 +1951,6 @@ (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")]) diff --git a/gcc/config/mn10300/mn10300.md b/gcc/config/mn10300/mn10300.md index 1747ebdb412..726418fba68 100644 --- a/gcc/config/mn10300/mn10300.md +++ b/gcc/config/mn10300/mn10300.md @@ -1397,8 +1397,6 @@ (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")]) @@ -1408,8 +1406,6 @@ (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")]) @@ -1419,8 +1415,6 @@ (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")]) @@ -1430,8 +1424,6 @@ (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")]) diff --git a/gcc/config/pyr/pyr.md b/gcc/config/pyr/pyr.md index 9aeab91e169..97d91014595 100644 --- a/gcc/config/pyr/pyr.md +++ b/gcc/config/pyr/pyr.md @@ -1224,8 +1224,6 @@ (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; diff --git a/gcc/genattrtab.c b/gcc/genattrtab.c index 9149c12d6eb..f71cd4d8447 100644 --- a/gcc/genattrtab.c +++ b/gcc/genattrtab.c @@ -348,6 +348,11 @@ static rtx true_rtx, false_rtx; 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) \ diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c index bff2b6ea2e8..efb70ea6130 100644 --- a/gcc/rtlanal.c +++ b/gcc/rtlanal.c @@ -1157,19 +1157,30 @@ dead_or_set_regno_p (insn, test_regno) 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 -- 2.30.2