* rtlanal.c (reg_set_p): Add check for regs_invalidated_by_call.
authorRoger Sayle <roger@eyesopen.com>
Mon, 19 Jul 2004 20:24:59 +0000 (20:24 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Mon, 19 Jul 2004 20:24:59 +0000 (20:24 +0000)
From-SVN: r84930

gcc/ChangeLog
gcc/rtlanal.c

index a9e147cca60cd0a8ff1763eaacbda8d44177ccb7..b83f93f7db7dd1681cfec90c31034f5ae1cdae3f 100644 (file)
@@ -1,3 +1,7 @@
+2004-07-19  Roger Sayle  <roger@eyesopen.com>
+
+       * rtlanal.c (reg_set_p): Add check for regs_invalidated_by_call.
+
 2004-07-19  Jeff Law  <law@redhat.com>
 
        * tree-ssa-dom.c (single_incoming_edge_ignoring_loop_edges): New.
index f3ce004bb2e81ced0dbac434f9bc4111d1d94074..4cdcb63037008439889ca9d4b91fb7aaeb3ee512 100644 (file)
@@ -941,14 +941,10 @@ reg_set_p (rtx reg, rtx insn)
   if (INSN_P (insn)
       && (FIND_REG_INC_NOTE (insn, reg)
          || (CALL_P (insn)
-             /* We'd like to test call_used_regs here, but rtlanal.c can't
-                reference that variable due to its use in genattrtab.  So
-                we'll just be more conservative.
-
-                ??? Unless we could ensure that the CALL_INSN_FUNCTION_USAGE
-                information holds all clobbered registers.  */
              && ((REG_P (reg)
-                  && REGNO (reg) < FIRST_PSEUDO_REGISTER)
+                  && REGNO (reg) < FIRST_PSEUDO_REGISTER
+                  && TEST_HARD_REG_BIT (regs_invalidated_by_call,
+                                        REGNO (reg)))
                  || MEM_P (reg)
                  || find_reg_fusage (insn, CLOBBER, reg)))))
     return 1;