This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch i386]: Add support of "hotfix" -feature for x64
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Kai Tietz <ktietz70 at googlemail dot com>
- Cc: Richard Henderson <rth at redhat dot com>, Kai Tietz <Kai dot Tietz at onevision dot com>, gcc-patches at gcc dot gnu dot org
- Date: Tue, 6 Jul 2010 22:27:35 -0700
- Subject: Re: [patch i386]: Add support of "hotfix" -feature for x64
- References: <OF8699C863.A8A79154-ONC1257752.00406953-C1257752.0041CC76@onevision.de> <4C2E26A6.4020002@redhat.com> <AANLkTin48nulplMh1JLXU2ypA1cevrinA4y_0pd2DRh4@mail.gmail.com>
On Sat, Jul 3, 2010 at 2:05 AM, Kai Tietz <ktietz70@googlemail.com> wrote:
> 2010/7/2 Richard Henderson <rth@redhat.com>:
>> On 06/30/2010 04:58 AM, Kai Tietz wrote:
>>> Hello,
>>>
>>> this patch adds the hot-patchabel Win32 feature used by Wine also for x64
>>> targets. Additionally it adds the missing feature part of adding prefix
>>> before function as hot-patchable area, as defined by win32 ABI.
>>
>> I like most of this patch. ?There are a few quirks...
>>
>> + ? ? ?while (filler_count > 0)
>> + ? ? ? ?{
>> + ? ? ? ? fprintf (asm_out_file, ASM_LONG " 0x%x", filler_cc);
>> + ? ? ? ? filler_count -= 4;
>> + ? ? ? ? while ((filler_count & 0xf) != 0)
>> + ? ? ? ? ? {
>> + ? ? ? ? ? ? fprintf (asm_out_file, ", 0x%x", filler_cc);
>> + ? ? ? ? ? ? filler_count -= 4;
>> + ? ? ? ? ? }
>> + ? ? ? ? fprintf (asm_out_file, "\n");
>> + ? ? ? }
>>
>> The double loop overcomplicates things. ?I think you're better off
>> with just a plain for-loop.
>>
>> + ? ? ? /* leaq [%rsp + 0], %rsp ?*/
>> + ? ? ? asm_fprintf (asm_out_file, ASM_BYTE "0x48, 0x8d, 0xa4, 0x24, 0x00, 0x00, 0x00, 0x00\n");
>>
>> Needs line wrap.
>>
>> ? ? ? ? Wine uses this to enable Windows apps to hook the Win32 API
>> ? ? ? ? functions provided by Wine. ?*/
>> - ? ? ?insn = emit_insn (gen_vswapmov (gen_rtx_REG (SImode, DI_REG),
>> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? gen_rtx_REG (SImode, DI_REG)));
>> ? ? ? push = emit_insn (gen_push (hard_frame_pointer_rtx));
>>
>> The preceeding comment needs adjusting to match the new code. ?Just
>> mentioning that the nop-move is emitted elsewhere should be enough.
>>
>>
>>
>> r~
>>
>
> Here is the patch with suggested corrections.
> Tested for i686-pc-linux and x86_64-pc-mingw32 targets. Ok for apply?
>
I have a very hard time to believe this patch was tested on i686-pc-linux
since revision 161876 is bogus for Linux and caused 5000+ run-time
failures in gcc testsuite on Linux/i686.
--
H.J.