From 154af1c53bb71471b1723d6359af859290b42d50 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Sat, 21 May 2011 22:05:52 +0000 Subject: [PATCH] sparc.c (eligible_for_return_delay): Do not return false if there are call-saved registers here... * 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 | 9 +++++++++ gcc/config/sparc/sparc.c | 10 +++------- gcc/config/sparc/sparc.h | 2 +- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1d4944db2e5f..f5651f79e627 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2011-05-21 Eric Botcazou + + * 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 PR rtl-optimization/48932 diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index 6c6aaddc0fb8..9f0bfa1dd21a 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -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); } diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h index 35a4c1e079cf..d34598db7586 100644 --- a/gcc/config/sparc/sparc.h +++ b/gcc/config/sparc/sparc.h @@ -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 -- 2.47.2