From 62835ceeccafa8e06329a83728e9b0b74be6b65b Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Sun, 15 Jan 2012 18:47:20 +0000 Subject: [PATCH] mips.c (mips16_build_call_stub): Don't use a stub for calls to locally-binding MIPS16 functions if... 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 | 6 ++++++ gcc/config/mips/mips.c | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 66c43f1..67c69aa 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2012-01-15 Richard Sandiford + + * 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 Richard Sandiford diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index b29ec4a..4a64ff2 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -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); -- 2.7.4