This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch i386]: Sibcall tail-call improvement and partial fix PR/60104
- From: Mike Stump <mikestump at comcast dot net>
- To: Kai Tietz <ktietz at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Jeff Law <law at redhat dot com>, Richard Henderson <rth at redhat dot com>
- Date: Sun, 14 Sep 2014 14:38:45 -0700
- Subject: Re: [patch i386]: Sibcall tail-call improvement and partial fix PR/60104
- Authentication-results: sourceware.org; auth=none
- References: <1478265243 dot 5697739 dot 1400792508558 dot JavaMail dot zimbra at redhat dot com>
On May 22, 2014, at 2:01 PM, Kai Tietz <ktietz@redhat.com> wrote:
> This patch adds a small improvement about sibling tail-calls.
So, I was hoping that you would weigh or fix the damage (PR61387) this does on darwin.
Here is a patch that fixes it.
Index: config/i386/i386.c
===================================================================
--- config/i386/i386.c (revision 215252)
+++ config/i386/i386.c (working copy)
@@ -38968,9 +38968,12 @@ x86_output_mi_thunk (FILE *file, tree, H
{
if (sibcall_insn_operand (fnaddr, word_mode))
{
- tmp = gen_rtx_CALL (VOIDmode, fnaddr, const0_rtx);
- tmp = emit_call_insn (tmp);
- SIBLING_CALL_P (tmp) = 1;
+ fnaddr = XEXP (DECL_RTL (function), 0);
+ tmp = gen_rtx_MEM (QImode, fnaddr);
+ tmp = gen_rtx_CALL (VOIDmode, tmp, const0_rtx);
+ tmp = emit_call_insn (tmp);
+ SIBLING_CALL_P (tmp) = 1;
+ SIBLING_CALL_P (tmp) = 1;
}
else
emit_jump_insn (gen_indirect_jump (fnaddr));
Ok?