aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@codesourcery.com>2014-12-01 12:56:08 +0000
committerMaciej W. Rozycki <macro@gcc.gnu.org>2014-12-01 12:56:08 +0000
commit9df0192130fd054a9edf84884ca7bbccf8f7679a (patch)
treed4b75e1a2a77fc2a2dc6d8c329b70a72f0679a3b
parent152ceb59c5cbf96a033816d38248273c3b5ceb2a (diff)
downloadgcc-9df0192130fd054a9edf84884ca7bbccf8f7679a.zip
gcc-9df0192130fd054a9edf84884ca7bbccf8f7679a.tar.gz
gcc-9df0192130fd054a9edf84884ca7bbccf8f7679a.tar.bz2
mips.c (mips16_build_call_stub): Move the save of the return address in $18 ahead of passing arguments to FPRs.
* config/mips/mips.c (mips16_build_call_stub): Move the save of the return address in $18 ahead of passing arguments to FPRs. From-SVN: r218209
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/mips/mips.c17
2 files changed, 17 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7aeb9bf..c31d8bc 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2014-12-01 Maciej W. Rozycki <macro@codesourcery.com>
+
+ * config/mips/mips.c (mips16_build_call_stub): Move the save of
+ the return address in $18 ahead of passing arguments to FPRs.
+
2014-12-01 Ilya Enkovich <ilya.enkovich@intel.com>
PR target/64055
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 5a53d5f..8599285 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -6942,6 +6942,17 @@ mips16_build_call_stub (rtx retval, rtx *fn_ptr, rtx args_size, int fp_code)
/* "Save" $sp in itself so we don't use the fake CFA.
This is: DW_CFA_val_expression r29, { DW_OP_reg29 }. */
fprintf (asm_out_file, "\t.cfi_escape 0x16,29,1,0x6d\n");
+
+ /* Save the return address in $18. The stub's caller knows
+ that $18 might be clobbered, even though $18 is usually
+ a call-saved register.
+
+ Do it early on in case the last move to a floating-point
+ register can be scheduled into the delay slot of the
+ call we are about to make. */
+ fprintf (asm_out_file, "\tmove\t%s,%s\n",
+ reg_names[GP_REG_FIRST + 18],
+ reg_names[RETURN_ADDR_REGNUM]);
}
else
{
@@ -6963,11 +6974,7 @@ mips16_build_call_stub (rtx retval, rtx *fn_ptr, rtx args_size, int fp_code)
if (fp_ret_p)
{
- /* Save the return address in $18 and call the non-MIPS16 function.
- The stub's caller knows that $18 might be clobbered, even though
- $18 is usually a call-saved register. */
- fprintf (asm_out_file, "\tmove\t%s,%s\n",
- reg_names[GP_REG_FIRST + 18], reg_names[RETURN_ADDR_REGNUM]);
+ /* Now call the non-MIPS16 function. */
output_asm_insn (MIPS_CALL ("jal", &fn, 0, -1), &fn);
fprintf (asm_out_file, "\t.cfi_register 31,18\n");