On May 22, 2014, at 2:01 PM, Kai Tietz <[email protected]> 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?