OSDN Git Service

2007-02-15 Paolo Bonzini <bonzini@gnu.org>
[pf3gnuchains/gcc-fork.git] / gcc / caller-save.c
index 86d74ee..4acb912 100644 (file)
@@ -1,6 +1,6 @@
 /* Save and restore call-clobbered registers which are live across a call.
-   Copyright (C) 1989, 1992, 1994, 1995, 1997, 1998,
-   1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 1989, 1992, 1994, 1995, 1997, 1998, 1999, 2000,
+   2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -407,7 +407,9 @@ save_call_clobbered_regs (void)
                  regno += insert_restore (chain, 1, regno, MOVE_MAX_WORDS, save_mode);
            }
 
-         if (code == CALL_INSN && ! find_reg_note (insn, REG_NORETURN, NULL))
+         if (code == CALL_INSN
+             && ! SIBLING_CALL_P (insn)
+             && ! find_reg_note (insn, REG_NORETURN, NULL))
            {
              unsigned regno;
              HARD_REG_SET hard_regs_to_save;
@@ -450,11 +452,6 @@ save_call_clobbered_regs (void)
                 during the call, but the subreg that is set isn't.  */
              CLEAR_HARD_REG_SET (this_insn_sets);
              note_stores (PATTERN (insn), mark_set_regs, &this_insn_sets);
-             /* Sibcalls are considered to set the return value,
-                compare flow.c:propagate_one_insn.  */
-             if (SIBLING_CALL_P (insn) && current_function_return_rtx)
-               mark_set_regs (current_function_return_rtx, NULL_RTX,
-                              &this_insn_sets);
 
              /* Compute which hard regs must be saved before this call.  */
              AND_COMPL_HARD_REG_SET (hard_regs_to_save, call_fixed_reg_set);
@@ -537,14 +534,15 @@ add_stored_regs (rtx reg, rtx setter, void *data)
   if (GET_CODE (setter) == CLOBBER)
     return;
 
-  if (GET_CODE (reg) == SUBREG && REG_P (SUBREG_REG (reg)))
+  if (GET_CODE (reg) == SUBREG
+      && REG_P (SUBREG_REG (reg))
+      && REGNO (SUBREG_REG (reg)) < FIRST_PSEUDO_REGISTER)
     {
       offset = subreg_regno_offset (REGNO (SUBREG_REG (reg)),
                                    GET_MODE (SUBREG_REG (reg)),
                                    SUBREG_BYTE (reg),
                                    GET_MODE (reg));
-      reg = SUBREG_REG (reg);
-      regno = REGNO (reg) + offset;
+      regno = REGNO (SUBREG_REG (reg)) + offset;
       endregno = regno + subreg_nregs (reg);
     }
   else