aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorOlivier Hainque <hainque@adacore.com>2010-08-20 08:03:41 +0000
committerOlivier Hainque <hainque@gcc.gnu.org>2010-08-20 08:03:41 +0000
commit891aa2ecc420149e34dabf08c84019bcd174a611 (patch)
tree74c67ec579c8652993e4cc89d1e5665ad68ed6c6 /gcc/config
parent07d5b92585ad8f3c1757335ae9d5320786f3f448 (diff)
downloadgcc-891aa2ecc420149e34dabf08c84019bcd174a611.zip
gcc-891aa2ecc420149e34dabf08c84019bcd174a611.tar.gz
gcc-891aa2ecc420149e34dabf08c84019bcd174a611.tar.bz2
sparc.c (sparc_asm_function_epilogue): Don't output an extra nop past a sibling call at the very end.
* config/sparc/sparc.c (sparc_asm_function_epilogue): Don't output an extra nop past a sibling call at the very end. testsuite/ * gcc.target/sparc/sibcall-dslot.c: New testcase. From-SVN: r163395
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/sparc/sparc.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index ef1dd73..50b981e 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -4527,11 +4527,11 @@ sparc_can_use_return_insn_p (void)
static void
sparc_asm_function_epilogue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
{
- /* If code does not drop into the epilogue, we have to still output
- a dummy nop for the sake of sane backtraces. Otherwise, if the
- last two instructions of a function were "call foo; dslot;" this
- can make the return PC of foo (i.e. address of call instruction
- plus 8) point to the first instruction in the next function. */
+ /* If the last two instructions of a function are "call foo; dslot;"
+ the return address might point to the first instruction in the next
+ function and we have to output a dummy nop for the sake of sane
+ backtraces in such cases. This is pointless for sibling calls since
+ the return address is explicitly adjusted. */
rtx insn, last_real_insn;
@@ -4543,7 +4543,9 @@ sparc_asm_function_epilogue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
&& GET_CODE (PATTERN (last_real_insn)) == SEQUENCE)
last_real_insn = XVECEXP (PATTERN (last_real_insn), 0, 0);
- if (last_real_insn && GET_CODE (last_real_insn) == CALL_INSN)
+ if (last_real_insn
+ && CALL_P (last_real_insn)
+ && !SIBLING_CALL_P (last_real_insn))
fputs("\tnop\n", file);
sparc_output_deferred_case_vectors ();