diff mbox

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

Message ID F83C249A-DC9A-495B-9E0E-6194F233701C@gmail.com
State New
Headers show

Commit Message

FX Coudert Sept. 20, 2014, 4:32 p.m. UTC
> The patch you sent (copied below) does not fix the darwin regression. It still fails with the same ICE on attached valid code (in 64-bit mode; it compiles with -m32).

The proposed patch by Iain’s patch (https://gcc.gnu.org/ml/gcc-patches/2014-09/msg01141.html and attached), which Mike seconds, fixes the issue. See the testresults I posted here: https://gcc.gnu.org/ml/gcc-testresults/2014-09/msg01449.html  (without the patch, there are 900+ testsuite failures)

Could one of the maintainers (i386 or global) review it, please?

FX
diff mbox

Patch

Index: gcc/config/i386/i386.c
===================================================================
--- gcc/config/i386/i386.c	(revision 215419)
+++ gcc/config/i386/i386.c	(working copy)
@@ -38968,9 +38968,11 @@  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;
 	}
       else
 	emit_jump_insn (gen_indirect_jump (fnaddr));