This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch i386]: Sibcall tail-call improvement and partial fix PR/60104


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?

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]