From: Arthur Norman Date: Wed, 2 Jan 2008 10:46:17 +0000 (+0100) Subject: (ix86_expand_prologue): Save red-zone while stack probing. X-Git-Tag: releases/gcc-4.3.0~779 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6893e828e53be18698ad20b10afa00f822dc244b;p=thirdparty%2Fgcc.git (ix86_expand_prologue): Save red-zone while stack probing. PR 34013. From-SVN: r131255 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7fc21c4d6a86..1524eac74422 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,6 +1,12 @@ +2008-01-02 Arthur Norman + + PR 34013 + * gcc/config/i386/i386.c: (ix86_expand_prologue): Save red-zone + while stack probing. + 2008-01-01 Douglas Gregor - * c-opts.c (sanitize_cpp_opts): Don't warn about "long long" when + * c-opts.c (sanitize_cpp_opts): Don't warn about "long long" when in C++0x mode. 2008-01-01 Volker Reichelt diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 232d6fe6b608..31931015fc58 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -6318,8 +6318,12 @@ ix86_expand_prologue (void) allocate += frame.nregs * UNITS_PER_WORD; /* When using red zone we may start register saving before allocating - the stack frame saving one cycle of the prologue. */ - if (TARGET_RED_ZONE && frame.save_regs_using_mov) + the stack frame saving one cycle of the prologue. However I will + avoid doing this if I am going to have to probe the stack since + at least on x86_64 the stack probe can turn into a call that clobbers + a red zone location */ + if (TARGET_RED_ZONE && frame.save_regs_using_mov + && (! TARGET_STACK_PROBE || allocate < CHECK_STACK_LIMIT)) ix86_emit_save_regs_using_mov (frame_pointer_needed ? hard_frame_pointer_rtx : stack_pointer_rtx, -frame.nregs * UNITS_PER_WORD); @@ -6375,7 +6379,9 @@ ix86_expand_prologue (void) } } - if (frame.save_regs_using_mov && !TARGET_RED_ZONE) + if (frame.save_regs_using_mov + && !(TARGET_RED_ZONE + && (! TARGET_STACK_PROBE || allocate < CHECK_STACK_LIMIT))) { if (!frame_pointer_needed || !frame.to_allocate) ix86_emit_save_regs_using_mov (stack_pointer_rtx, frame.to_allocate);