This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch i386]: Change stack probing and allocation implementation


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.


r~

Attachment: z
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]