]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
flow.c (propagate_one_insn): Preserve live-at-end registers across tail calls.
authorRichard Henderson <rth@redhat.com>
Thu, 26 Jun 2003 20:29:55 +0000 (13:29 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Thu, 26 Jun 2003 20:29:55 +0000 (13:29 -0700)
        * flow.c (propagate_one_insn): Preserve live-at-end registers
        across tail calls.

From-SVN: r68544

gcc/ChangeLog
gcc/flow.c

index 735494437d493aae2cc69800d6a5a3103374fa02..274e7a531ab9d515da9ff2a2c199c7f0b35abd1e 100644 (file)
@@ -1,3 +1,8 @@
+2003-06-26  Richard Henderson  <rth@redhat.com>
+
+       * flow.c (propagate_one_insn): Preserve live-at-end registers
+       across tail calls.
+
 2003-06-26  J"orn Rennecke <joern.rennecke@superh.com>
 
        * reload.c (can_reload_into): New function.
index b08a6e8e3318e9b56eb66a48c8a1d88ba859188d..58859405aab3c2bb5ce8a9760d3ccb533ba0fece 100644 (file)
@@ -1770,8 +1770,10 @@ propagate_one_insn (pbi, insn)
 
       if (GET_CODE (insn) == CALL_INSN)
        {
-         int i;
+         regset live_at_end;
+         bool sibcall_p;
          rtx note, cond;
+         int i;
 
          cond = NULL_RTX;
          if (GET_CODE (PATTERN (insn)) == COND_EXEC)
@@ -1796,9 +1798,14 @@ propagate_one_insn (pbi, insn)
              mark_set_1 (pbi, CLOBBER, XEXP (XEXP (note, 0), 0),
                          cond, insn, pbi->flags);
 
-         /* Calls change all call-used and global registers.  */
+         /* Calls change all call-used and global registers; sibcalls do not
+            clobber anything that must be preserved at end-of-function.  */
+
+         sibcall_p = SIBLING_CALL_P (insn);
+         live_at_end = EXIT_BLOCK_PTR->global_live_at_start;
          for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
-           if (TEST_HARD_REG_BIT (regs_invalidated_by_call, i))
+           if (TEST_HARD_REG_BIT (regs_invalidated_by_call, i)
+               && ! (sibcall_p && REGNO_REG_SET_P (live_at_end, i)))
              {
                /* We do not want REG_UNUSED notes for these registers.  */
                mark_set_1 (pbi, CLOBBER, regno_reg_rtx[i], cond, insn,