aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sandiford <rsandifo@nildram.co.uk>2007-10-21 09:18:12 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2007-10-21 09:18:12 +0000
commit9be10a794480e2d7a19c81cebaf02a6d2a54ff23 (patch)
tree287561bd7db8c036b3c4d54488df38520de9cb2a
parente0681eaad4faf1291ee1f9c56862b5b093309bb1 (diff)
downloadgcc-9be10a794480e2d7a19c81cebaf02a6d2a54ff23.zip
gcc-9be10a794480e2d7a19c81cebaf02a6d2a54ff23.tar.gz
gcc-9be10a794480e2d7a19c81cebaf02a6d2a54ff23.tar.bz2
mips.c (mips_function_ok_for_sibcall): Only forbid sibling calls to "mips16" functions if...
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
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/mips/mips.c11
2 files changed, 12 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index bc3741c..83e0e0a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
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
to build_int_cst.
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index afec3a2..2985871 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -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)