Commit 35511751 by Bernd Schmidt Committed by Bernd Schmidt

mips.c (mips_expand_epilogue): Generate a simple_return only if the return address is in r31.

	* config/mips/mips.c (mips_expand_epilogue): Generate a
	simple_return only if the return address is in r31.

From-SVN: r178847
parent d4eb3668
2011-09-14 Bernd Schmidt <bernds@codesourcery.com>
* config/mips/mips.c (mips_expand_epilogue): Generate a
simple_return only if the return address is in r31.
2011-09-13 Bernd Schmidt <bernds@codesourcery.com> 2011-09-13 Bernd Schmidt <bernds@codesourcery.com>
* cfgcleanup.c (try_head_merge_bb): If get_condition returns * cfgcleanup.c (try_head_merge_bb): If get_condition returns
...@@ -10521,7 +10521,7 @@ mips_expand_epilogue (bool sibcall_p) ...@@ -10521,7 +10521,7 @@ mips_expand_epilogue (bool sibcall_p)
} }
else else
{ {
unsigned int regno; rtx pat;
/* When generating MIPS16 code, the normal /* When generating MIPS16 code, the normal
mips_for_each_saved_gpr_and_fpr path will restore the return mips_for_each_saved_gpr_and_fpr path will restore the return
...@@ -10529,11 +10529,21 @@ mips_expand_epilogue (bool sibcall_p) ...@@ -10529,11 +10529,21 @@ mips_expand_epilogue (bool sibcall_p)
if (TARGET_MIPS16 if (TARGET_MIPS16
&& !GENERATE_MIPS16E_SAVE_RESTORE && !GENERATE_MIPS16E_SAVE_RESTORE
&& BITSET_P (frame->mask, RETURN_ADDR_REGNUM)) && BITSET_P (frame->mask, RETURN_ADDR_REGNUM))
regno = GP_REG_FIRST + 7; {
/* simple_returns cannot rely on values that are only available
on paths through the epilogue (because return paths that do
not pass through the epilogue may nevertheless reuse a
simple_return that occurs at the end of the epilogue).
Use a normal return here instead. */
rtx reg = gen_rtx_REG (Pmode, GP_REG_FIRST + 7);
pat = gen_return_internal (reg);
}
else else
regno = RETURN_ADDR_REGNUM; {
emit_jump_insn (gen_simple_return_internal (gen_rtx_REG (Pmode, rtx reg = gen_rtx_REG (Pmode, RETURN_ADDR_REGNUM);
regno))); pat = gen_simple_return_internal (reg);
}
emit_jump_insn (pat);
} }
} }
......
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