From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1285) id 55E8B3858C31; Wed, 15 Feb 2023 22:33:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 55E8B3858C31 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1676500436; bh=aPRjLr6IX8zzRkShLv7ONcy1V0Pvsmp7vGqKJCd6P30=; h=From:To:Subject:Date:From; b=INAzx8b/DEG04tGaEsiRzBY24DwGnvNt8q97wshw4FDMzqpwhQfg4WWhpY4NOG8RJ YVSASaNvFgJbbr+4JZQEyEEY/TQlfm+bMWvSVWUU6ahwfGrGCPhqPnDS8q63+tFd4B ysZijPQlgEIEWBn5qSOhUqHoAznvhK0mvT0ykq/M= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Eric Botcazou To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-6069] Fix PR target/90458 X-Act-Checkin: gcc X-Git-Author: Eric Botcazou X-Git-Refname: refs/heads/master X-Git-Oldrev: d6d3de7170670f55825a28e84a9a89a17381a19f X-Git-Newrev: a5dd99f7ef4fa5f9542851431bdd149a22b87fd2 Message-Id: <20230215223356.55E8B3858C31@sourceware.org> Date: Wed, 15 Feb 2023 22:33:56 +0000 (GMT) List-Id: https://gcc.gnu.org/g:a5dd99f7ef4fa5f9542851431bdd149a22b87fd2 commit r13-6069-ga5dd99f7ef4fa5f9542851431bdd149a22b87fd2 Author: Eric Botcazou 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.cc (ix86_compute_frame_layout): Disable the effects of -fstack-clash-protection for TARGET_STACK_PROBE. (ix86_expand_prologue): Likewise. Diff: --- gcc/config/i386/i386.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc index 3cacf738c4a..22f444be23c 100644 --- a/gcc/config/i386/i386.cc +++ b/gcc/config/i386/i386.cc @@ -6876,7 +6876,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 () @@ -8761,8 +8763,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;