This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch i386]: Change stack probing and allocation implementation
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: Kai Tietz <ktietz70 at googlemail dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 20 Oct 2010 12:11:58 -0700
- Subject: Re: [patch i386]: Change stack probing and allocation implementation
- References: <AANLkTinuixxj127Sj6E1Rz2fXWyuOW7u5GnozLJ8zsQg@mail.gmail.com> <AANLkTimONORnHtZ6gJ+RN9Yac2qG2uPUAoOrw6iRy0Tp@mail.gmail.com> <4C9EC74C.4080009@redhat.com>
On Sat, Sep 25, 2010 at 9:08 PM, Richard Henderson <rth@redhat.com> wrote:
> On 08/21/2010 08:23 AM, Kai Tietz wrote:
>> 2010/8/19 Kai Tietz <ktietz70@googlemail.com>:
>>> Hello,
>>>
>>> the behavior of i386's stack allocation with probing (via ___chkstk)
>>> has some disadvantages. First the probing code is more costy on
>>> execution then necessary - this hits mainly win32 targets where
>>> stack-probing is active by default for stack-allocation >= 0x1000
>>> bytes - and it is additionally incompatible to the variant of chkstk
>>> in msvcrt.
>>> Additionally this new version avoids some register clobbering for
>>> 64-bit and it simplifies the prologue generation a bit.
>>>
>>> 2010-08-19 ?Kai Tietz
>>>
>>> ? ? ? ?* config/i386/cygwin.asm (___chkstk_ms): New.
>>> ? ? ? ?* config/i386/i386.c (override_options): Replace
>>> ? ? ? ?gen_allocate_stack_worker_,, by gen_allocate_stack_worker_probe_,,.
>>> ? ? ? ?(ix86_expand_prologue): Adjust probed stack allocation.
>>> ? ? ? ?* config/i386/i386.md (define_insn "allocate_stack_worker_32): Removed.
>>> ? ? ? ?(define_insn "allocate_stack_worker_64): Removed.
>>> ? ? ? ?(define_insn "allocate_stack_worker_probe_32): New.
>>> ? ? ? ?(define_insn "allocate_stack_worker_probe_64): New.
>>> ? ? ? ?(allocate_stack): Adjust probed stack allocation.
>
> I altered the patch a bit. ?Tidied up the .md changes with macros,
> tidied up the assembly file with multiple object files and dwarf2
> unwind info. ?Adjusted the prologue code to use the value in eax.
>
> Tested on i686-cygwin, i686-linux, x86_64-linux, x86_63-mingw.
> Committed.
>
This caused:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46095
--
H.J.