]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
sparc.c (eligible_for_return_delay): Do not return false if there are call-saved...
authorEric Botcazou <ebotcazou@adacore.com>
Sat, 21 May 2011 22:05:52 +0000 (22:05 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Sat, 21 May 2011 22:05:52 +0000 (22:05 +0000)
* config/sparc/sparc.c (eligible_for_return_delay): Do not return
false if there are call-saved registers here...
(sparc_can_use_return_insn_p): ...but here instead.
(save_or_restore_regs): Fix thinko.
(sparc_expand_prologue): Use current_function_is_leaf.
* config/sparc/sparc.h (FRAME_POINTER_REQUIRED) : Likewise.

From-SVN: r174012

gcc/ChangeLog
gcc/config/sparc/sparc.c
gcc/config/sparc/sparc.h

index 1d4944db2e5f436f15518d576bcfe924bca9c9d9..f5651f79e62711153abc578a9f7ce611143fda7b 100644 (file)
@@ -1,3 +1,12 @@
+2011-05-21  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * config/sparc/sparc.c (eligible_for_return_delay): Do not return
+       false if there are call-saved registers here...
+       (sparc_can_use_return_insn_p): ...but here instead.
+       (save_or_restore_regs): Fix thinko.
+       (sparc_expand_prologue): Use current_function_is_leaf.
+       * config/sparc/sparc.h (FRAME_POINTER_REQUIRED) : Likewise.
+
 2011-05-14  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
 
        PR rtl-optimization/48932
index 6c6aaddc0fb84fc43a9b78740680eb14f9b6abcb..9f0bfa1dd21a508cd61cffade25be93f71eeb485 100644 (file)
@@ -2636,11 +2636,6 @@ eligible_for_return_delay (rtx trial)
   if (get_attr_length (trial) != 1)
     return 0;
 
-  /* If there are any call-saved registers, we should scan TRIAL if it
-     does not reference them.  For now just make it easy.  */
-  if (num_gfregs)
-    return 0;
-
   /* If the function uses __builtin_eh_return, the eh_return machinery
      occupies the delay slot.  */
   if (crtl->calls_eh_return)
@@ -3922,7 +3917,7 @@ save_or_restore_regs (int low, int high, rtx base, int offset, int action)
            emit_move_insn (gen_rtx_REG (mode, regno), mem);
 
          /* Always preserve double-word alignment.  */
-         offset = (offset + 7) & -8;
+         offset = (offset + 8) & -8;
        }
     }
 
@@ -4029,7 +4024,7 @@ sparc_expand_prologue (void)
      example, the regrename pass has special provisions to not rename to
      non-leaf registers in a leaf function.  */
   sparc_leaf_function_p
-    = optimize > 0 && leaf_function_p () && only_leaf_regs_used ();
+    = optimize > 0 && current_function_is_leaf && only_leaf_regs_used ();
 
   /* Need to use actual_fsize, since we are also allocating
      space for our callee (and our own register save area).  */
@@ -4155,6 +4150,7 @@ bool
 sparc_can_use_return_insn_p (void)
 {
   return sparc_prologue_data_valid_p
+        && num_gfregs == 0
         && (actual_fsize == 0 || !sparc_leaf_function_p);
 }
   
index 35a4c1e079cf383a1d47219d772806143e3d2cda..d34598db7586c07b4ab8395c640c5ea310a43616 100644 (file)
@@ -970,7 +970,7 @@ extern int sparc_mode_class[];
    may be accessed via the stack pointer) in functions that seem suitable.
    Used in flow.c, global.c, ra.c and reload1.c.  */
 #define FRAME_POINTER_REQUIRED \
-  (! (leaf_function_p () && only_leaf_regs_used ()))
+  (!(current_function_is_leaf && only_leaf_regs_used ()))
 
 /* Base register for access to arguments of the function.  */
 #define ARG_POINTER_REGNUM FRAME_POINTER_REGNUM