This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch i386]: Fix in x86_output_mi_thunk for this_param
- From: Uros Bizjak <ubizjak at gmail dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Kai Tietz <ktietz70 at googlemail dot com>
- Date: Sun, 04 May 2008 20:26:54 +0200
- Subject: Re: [patch i386]: Fix in x86_output_mi_thunk for this_param
Hello!
Correct for x86_64 the initialization of this_param by using movq for
TARGET_64BIT.
Looking at the code, it looks that we also need this fix in another place (please see attached patch).
ChangeLog
2008-05-04 Kai Tietz <kai.tietz@onevision.com>
* config/i386/i386.c (x86_output_mi_thunk): Use for TARGET_64BIT
movq for this_param move.
... Use movq alternative mnemonic in this_param move for TARGET_64BIT ...
This is OK for mainline and for 4.3 after a couple of days without
problems in mainline.
BTW: Do you perhaps have a testcase that triggers this bug?
Thanks,
Uros.
Index: i386.c
===================================================================
--- i386.c (revision 134932)
+++ i386.c (working copy)
@@ -23042,7 +23042,10 @@
/* Put the this parameter into %eax. */
xops[0] = this_param;
xops[1] = this_reg = gen_rtx_REG (Pmode, AX_REG);
- output_asm_insn ("mov{l}\t{%0, %1|%1, %0}", xops);
+ if (TARGET_64BIT)
+ output_asm_insn ("mov{q}\t{%0, %1|%1, %0}", xops);
+ else
+ output_asm_insn ("mov{l}\t{%0, %1|%1, %0}", xops);
}
else
this_reg = NULL_RTX;
@@ -23111,7 +23114,10 @@
{
xops[0] = this_reg;
xops[1] = this_param;
- output_asm_insn ("mov{l}\t{%0, %1|%1, %0}", xops);
+ if (TARGET_64BIT)
+ output_asm_insn ("mov{q}\t{%0, %1|%1, %0}", xops);
+ else
+ output_asm_insn ("mov{l}\t{%0, %1|%1, %0}", xops);
}
xops[0] = XEXP (DECL_RTL (function), 0);