]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
mips.c (mips_function_ok_for_sibcall): Only forbid sibling calls to "mips16" function...
authorRichard Sandiford <rsandifo@nildram.co.uk>
Sun, 21 Oct 2007 09:18:12 +0000 (09:18 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Sun, 21 Oct 2007 09:18:12 +0000 (09:18 +0000)
gcc/
* config/mips/mips.c (mips_function_ok_for_sibcall): Only forbid
sibling calls to "mips16" functions if the function satisfies
const_call_insn_operand.

From-SVN: r129526

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

index bc3741c0dce3f7ac6b3929d62f700fefd5eae3d8..83e0e0a137a2e2992c5ecca0c3138ad10b92a5ef 100644 (file)
@@ -1,3 +1,9 @@
+2007-10-21  Richard Sandiford  <rsandifo@nildram.co.uk>
+
+       * config/mips/mips.c (mips_function_ok_for_sibcall): Only forbid
+       sibling calls to "mips16" functions if the function satisfies
+       const_call_insn_operand.
+
 2007-10-21  Richard Sandiford  <rsandifo@nildram.co.uk>
 
        * config/mips/mips.c (mips_va_start): Fix types in calls
index afec3a29b3db2060199a0578a5ebfc2fc6b4a186..298587185f49ef02f7b2ad9bdb5d2f828f768edf 100644 (file)
@@ -5648,14 +5648,15 @@ mips_function_ok_for_sibcall (tree decl, tree exp ATTRIBUTE_UNUSED)
 
   /* We can't do a sibcall if the called function is a MIPS16 function
      because there is no direct "jx" instruction equivalent to "jalx" to
-     switch the ISA mode.  */
-  if (mips_use_mips16_mode_p (decl))
+     switch the ISA mode.  We only care about cases where the sibling
+     and normal calls would both be direct.  */
+  if (mips_use_mips16_mode_p (decl)
+      && const_call_insn_operand (XEXP (DECL_RTL (decl), 0), VOIDmode))
     return false;
 
-  /* ...and when -minterlink-mips16 is in effect, assume that external
+  /* When -minterlink-mips16 is in effect, assume that external
      functions could be MIPS16 ones unless an attribute explicitly
-     tells us otherwise.  We only care about cases where the sibling
-     and normal calls would both be direct.  */
+     tells us otherwise.  */
   if (TARGET_INTERLINK_MIPS16
       && decl
       && DECL_EXTERNAL (decl)