From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by sourceware.org (Postfix) with ESMTPS id D67EB3858D35 for ; Wed, 15 Feb 2023 15:24:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D67EB3858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-wr1-x42a.google.com with SMTP id k3so11898350wrv.5 for ; Wed, 15 Feb 2023 07:24:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=PywFf3oVuOOCrcLtssPpVQYSjQpl1j64IssGj6KYPq0=; b=AcNFO7qNdQDQME4II3dmSp7NV3ypdKAX5P3F16MqDyYagxTNWYZ+E9O58VMcZvr3Dg HbLjfFF6qsn/ViIfT5Gp/aj+pWi2G907wCep2IsBzhDsiOOViGzb66LiRdMCK56kGseL I6F0bC0eCppfryztDVOsZwXk4Sd8csoBtmvigGLNfjlOEAoQIt51UFd5Yp41qkYmJAYW icB5BLcZp1QUcxo3HqUa4w3todO/B6AAuQ6viFulH+kuxC0XYCaprpPJqCHJ6URe3QgV wOs17OMQEGFXSieHX+vz2bCreLV9FzY7M0iRKKt9Xy7Lf9LXOaO45gJ/82cVbKq94FaH QulQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=PywFf3oVuOOCrcLtssPpVQYSjQpl1j64IssGj6KYPq0=; b=vps8md8DpyQhy8qL92upq5xYNA82EHwA3UdCj6YAhTnQrQRn1W9RmFWX1taitlTxb/ d2EHD2BUkclVEJYzkS3eUPKO8n773jzXH9pMPkO3EBwi5PCrmMBjkhKiWu0OrQnarFMR U+wLq9GbNxAyCpmqJPwsy0mWshCbgtpJa31mIcGv3pKRlG01BfQbhld9Er2fTlpSq1bz DWdB9+7Wry/p6eX98KHVvHPUKyqlBtsh5Q9AJFsXTYnJtxQcguMGyG1qklkuambSUBGL LzZGo3XHESZ0+hHWtyGQ0jXEPiC+tXZ3xPeqCm23eRkVy/8VCmlW+MvzjX5XRzJ7HVKn H29w== X-Gm-Message-State: AO0yUKWtpyKqfW6v4163H7H8CYZaWBE+8L8v1jk/MXlXqSYLVopSS0j4 qbZap+Y5iAE63x2cKgMeDLO6o6cnIDbuJ51Q X-Google-Smtp-Source: AK7set/Nu8NDDsdVFrPH71VCGHZ7N8lUPHOcUIlFe8kkm0pwzDc77cjePMAr2sKMSUH69i0H51elNQ== X-Received: by 2002:adf:ef0f:0:b0:2c5:4c93:d819 with SMTP id e15-20020adfef0f000000b002c54c93d819mr2152422wro.8.1676474650793; Wed, 15 Feb 2023 07:24:10 -0800 (PST) Received: from fomalhaut.localnet ([2a01:e0a:8d5:d990:e654:e8ff:fe8f:2ce6]) by smtp.gmail.com with ESMTPSA id e29-20020a5d595d000000b002c53cc7504csm15660214wri.78.2023.02.15.07.24.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Feb 2023 07:24:10 -0800 (PST) From: Eric Botcazou X-Google-Original-From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix PR target/90458 Date: Wed, 15 Feb 2023 16:24:09 +0100 Message-ID: <8221231.NyiUUSuA9g@fomalhaut> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart1941339.usQuhbGJ8B" Content-Transfer-Encoding: 7Bit X-Spam-Status: No, score=-10.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: This is a multi-part message in MIME format. --nextPart1941339.usQuhbGJ8B Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Hi, 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. Tested on x86-64/Windows and Linux, OK for all active branches? 2023-02-15 Eric Botcazou * config/i386/i386.cc (ix86_compute_frame_layout): Disable the effects of -fstack-clash-protection for TARGET_STACK_PROBE. (ix86_expand_prologue): Likewise. -- Eric Botcazou --nextPart1941339.usQuhbGJ8B Content-Disposition: attachment; filename="pr90458.diff" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="UTF-8"; name="pr90458.diff" 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; --nextPart1941339.usQuhbGJ8B--