mips.c (mips16_build_call_stub): Don't use a stub for calls to locally-binding MIPS16...
authorRichard Sandiford <rdsandiford@googlemail.com>
Sun, 15 Jan 2012 18:47:20 +0000 (18:47 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Sun, 15 Jan 2012 18:47:20 +0000 (18:47 +0000)
gcc/
* config/mips/mips.c (mips16_build_call_stub): Don't use a stub
for calls to locally-binding MIPS16 functions if only the return
type uses float regs.

From-SVN: r183197

gcc/ChangeLog
gcc/config/mips/mips.c

index 66c43f1..67c69aa 100644 (file)
@@ -1,3 +1,9 @@
+2012-01-15  Richard Sandiford  <rdsandiford@googlemail.com>
+
+       * config/mips/mips.c (mips16_build_call_stub): Don't use a stub
+       for calls to locally-binding MIPS16 functions if only the return
+       type uses float regs.
+
 2012-01-15  Chung-Lin Tang  <cltang@codesourcery.com>
            Richard Sandiford  <rdsandiford@googlemail.com>
 
index b29ec4a..4a64ff2 100644 (file)
@@ -6172,6 +6172,13 @@ mips16_build_call_stub (rtx retval, rtx *fn_ptr, rtx args_size, int fp_code)
   if (mips16_stub_function_p (fn))
     return NULL_RTX;
 
+  /* If we're calling a locally-defined MIPS16 function, we know that
+     it will return values in both the "soft-float" and "hard-float"
+     registers.  There is no need to use a stub to move the latter
+     to the former.  */
+  if (fp_code == 0 && mips16_local_function_p (fn))
+    return NULL_RTX;
+
   /* This code will only work for o32 and o64 abis.  The other ABI's
      require more sophisticated support.  */
   gcc_assert (TARGET_OLDABI);