Commit 6d1e6c0f by Eric Botcazou

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.
	(sparc_frame_pointer_required): Likewise.

From-SVN: r174008
parent fa4a1e46
...@@ -2808,11 +2808,6 @@ eligible_for_return_delay (rtx trial) ...@@ -2808,11 +2808,6 @@ eligible_for_return_delay (rtx trial)
if (get_attr_length (trial) != 1) if (get_attr_length (trial) != 1)
return 0; 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 /* If the function uses __builtin_eh_return, the eh_return machinery
occupies the delay slot. */ occupies the delay slot. */
if (crtl->calls_eh_return) if (crtl->calls_eh_return)
...@@ -4400,7 +4395,7 @@ save_or_restore_regs (int low, int high, rtx base, int offset, int action) ...@@ -4400,7 +4395,7 @@ save_or_restore_regs (int low, int high, rtx base, int offset, int action)
emit_move_insn (gen_rtx_REG (mode, regno), mem); emit_move_insn (gen_rtx_REG (mode, regno), mem);
/* Always preserve double-word alignment. */ /* Always preserve double-word alignment. */
offset = (offset + 7) & -8; offset = (offset + 8) & -8;
} }
} }
...@@ -4507,7 +4502,7 @@ sparc_expand_prologue (void) ...@@ -4507,7 +4502,7 @@ sparc_expand_prologue (void)
example, the regrename pass has special provisions to not rename to example, the regrename pass has special provisions to not rename to
non-leaf registers in a leaf function. */ non-leaf registers in a leaf function. */
sparc_leaf_function_p 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 /* Need to use actual_fsize, since we are also allocating
space for our callee (and our own register save area). */ space for our callee (and our own register save area). */
...@@ -4637,6 +4632,7 @@ bool ...@@ -4637,6 +4632,7 @@ bool
sparc_can_use_return_insn_p (void) sparc_can_use_return_insn_p (void)
{ {
return sparc_prologue_data_valid_p return sparc_prologue_data_valid_p
&& num_gfregs == 0
&& (actual_fsize == 0 || !sparc_leaf_function_p); && (actual_fsize == 0 || !sparc_leaf_function_p);
} }
...@@ -9796,7 +9792,7 @@ sparc_expand_compare_and_swap_12 (rtx result, rtx mem, rtx oldval, rtx newval) ...@@ -9796,7 +9792,7 @@ sparc_expand_compare_and_swap_12 (rtx result, rtx mem, rtx oldval, rtx newval)
bool bool
sparc_frame_pointer_required (void) sparc_frame_pointer_required (void)
{ {
return !(leaf_function_p () && only_leaf_regs_used ()); return !(current_function_is_leaf && only_leaf_regs_used ());
} }
/* The way this is structured, we can't eliminate SFP in favor of SP /* The way this is structured, we can't eliminate SFP in favor of SP
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment