public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-10527] Fix PR target/90458
@ 2023-02-15 22:52 Eric Botcazou
  0 siblings, 0 replies; only message in thread
From: Eric Botcazou @ 2023-02-15 22:52 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:20c12f40f9b10eb290fcfe4d02f3367842be573a

commit r11-10527-g20c12f40f9b10eb290fcfe4d02f3367842be573a
Author: Eric Botcazou <ebotcazou@adacore.com>
Date:   Wed Feb 15 23:32:12 2023 +0100

    Fix PR target/90458
    
    This is the incompatibility of -fstack-clash-protection with Windows SEH.
    Now the Windows ports always enable TARGET_STACK_PROBE, which means that
    the stack is always probed (out of line) so -fstack-clash-protection does
    nothing more.
    
    gcc/
            PR target/90458
            * config/i386/i386.c (ix86_compute_frame_layout): Disable the
            effects of -fstack-clash-protection for TARGET_STACK_PROBE.
            (ix86_expand_prologue): Likewise.

Diff:
---
 gcc/config/i386/i386.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 1623bbcbd2d..9832d4e0320 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -6617,7 +6617,9 @@ ix86_compute_frame_layout (void)
 	 stack clash protections are enabled and the allocated frame is
 	 larger than the probe interval, then use pushes to save
 	 callee saved registers.  */
-      || (flag_stack_clash_protection && to_allocate > get_probe_interval ()))
+      || (flag_stack_clash_protection
+	  && !ix86_target_stack_probe ()
+	  && to_allocate > get_probe_interval ()))
     frame->save_regs_using_mov = false;
 
   if (ix86_using_red_zone ()
@@ -8492,8 +8494,11 @@ ix86_expand_prologue (void)
       sse_registers_saved = true;
     }
 
-  /* If stack clash protection is requested, then probe the stack.  */
-  if (allocate >= 0 && flag_stack_clash_protection)
+  /* If stack clash protection is requested, then probe the stack, unless it
+     is already probed on the target.  */
+  if (allocate >= 0
+      && flag_stack_clash_protection
+      && !ix86_target_stack_probe ())
     {
       ix86_adjust_stack_and_probe (allocate, int_registers_saved, false);
       allocate = 0;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-02-15 22:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-15 22:52 [gcc r11-10527] Fix PR target/90458 Eric Botcazou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).