From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on2052.outbound.protection.outlook.com [40.107.14.52]) by sourceware.org (Postfix) with ESMTPS id C64583858D39 for ; Mon, 23 Oct 2023 12:28:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C64583858D39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C64583858D39 Authentication-Results: server2.sourceware.org; arc=fail smtp.remote-ip=40.107.14.52 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1698064134; cv=fail; b=rYVrL5eOx5OSezrXWgYy25ZLmftN3M/FAJyJl/u3rHuJd393mF60ywDwBahk4IUoKPK99+SR7E3FibbXmuKB6h6CK9w5zPCd3EuPf20Xy++kFWUlcMr2dcDqw2rJ3NpWembrPLz9GyEnqFiYti4Tue2vdsqX74cwUa520k1S2Ms= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1698064134; c=relaxed/simple; bh=Ghgan1tFr+/PDyJydcHv6QiAh4EPLbgUnvSebuzhcco=; h=DKIM-Signature:DKIM-Signature:Date:From:To:Subject:Message-ID: MIME-Version; b=lGUgLPJJ5hPYI93RSLEIsHVFaUinrU+4DLE4gyR+797lDtQmSZbFDTNdFSzt7PzkuiHTeutuFgblCPlb9KuIh1hixcKnBnbcqy0MQ335vkGgdGN8HTjji6qTWVuFy9NGmZq13Li2MQ0r/xAMfuZdWshh0fG00H4NXzrL6T3xbkM= ARC-Authentication-Results: i=2; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZPUNNGbdmHIo1IMfrnwsV/GBmusPweuC4opDQ+c8jbI=; b=QqsmK8LnGCTWny5qrcvpbGqxr/sJPUl/dgiQwWK+Ft4CPV+5QYO97pcbAW7ASU8Uo5e5jEMG+naAhb4Jdw3kjJibo1Y5b7oRgmdxQcVFf1PTmQe3gtlCwTFNPu1MSD8nS+xUAq83ug8tij64BE7Q5+zs+Q+Mm8Rs5kHLAForYts= Received: from AS9PR06CA0239.eurprd06.prod.outlook.com (2603:10a6:20b:45e::35) by AS8PR08MB9477.eurprd08.prod.outlook.com (2603:10a6:20b:5ee::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.29; Mon, 23 Oct 2023 12:28:44 +0000 Received: from AMS0EPF0000019E.eurprd05.prod.outlook.com (2603:10a6:20b:45e:cafe::72) by AS9PR06CA0239.outlook.office365.com (2603:10a6:20b:45e::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.31 via Frontend Transport; Mon, 23 Oct 2023 12:28:44 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AMS0EPF0000019E.mail.protection.outlook.com (10.167.16.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.15 via Frontend Transport; Mon, 23 Oct 2023 12:28:44 +0000 Received: ("Tessian outbound d9a8e74be042:v215"); Mon, 23 Oct 2023 12:28:43 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 34d6ad2106fb7c56 X-CR-MTA-TID: 64aa7808 Received: from 95d7aa1a4e4b.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 6D3F339D-F4EE-445E-BCB0-E20D76F94DC2.1; Mon, 23 Oct 2023 12:28:37 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 95d7aa1a4e4b.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 23 Oct 2023 12:28:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZCX+yqMJNB0Zj65lNCTf5UlnrIkkyf5UNCW26bID7R6QcrWRC2wGGGsGGCfFMoV0/1sLeHFTYvhLKQHeWt85omkVOQT7Ky2pxCkvFEQms93SUU2TtztyYkzVRK/qODGEKk7g7mC47YrAr2lREq0/Rw08Wp21yqnBeShmi/j2P/0Fps44eCyybVRClTyc/oWLXByp4bMAcjgf+Lu+emgu6DAS5IkhnG/yZ5GKBVHLKXWOHC33dwXIZWe5aE/YCYZnWxej+e3HNYK8cbjP6Ht71nv131+U2Sths1OheN+qvPznXoU0BaBp5Zg2xCFO6BzsNRD0PwAe0oJ2bJ65SSX98A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ZPUNNGbdmHIo1IMfrnwsV/GBmusPweuC4opDQ+c8jbI=; b=TOq1Um/d6BcyTqohA7qF/R+uwkGhJseFNpjr2FnVW38uHhHD7s1nacJQSGEKD93fQBZ7MIc1PJgAS37VtYdO9JJi3RRKkghPRKZf9EwPC73YpuvNVgYpMwdxKYHXqlUezUKicTG3l7HGn5+QtY/Ndvp62b6QAGf0056kOjyzJyZuCj9cDrD8kYyKlhZBnM1Muu01WqbsCyjz1db7uV1F1+n0k3SCkIIbn+ivb+rXhC6u7tg4QN6V47AZpfqHf+yQEQL81cHNOlJp9Rg0NhOlwSCGvwx5UohPC4Wu+VmhJquEs76vjN4mux6OypZHpM786mVKoRO3E+dqMr6Cf9ssOA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZPUNNGbdmHIo1IMfrnwsV/GBmusPweuC4opDQ+c8jbI=; b=QqsmK8LnGCTWny5qrcvpbGqxr/sJPUl/dgiQwWK+Ft4CPV+5QYO97pcbAW7ASU8Uo5e5jEMG+naAhb4Jdw3kjJibo1Y5b7oRgmdxQcVFf1PTmQe3gtlCwTFNPu1MSD8nS+xUAq83ug8tij64BE7Q5+zs+Q+Mm8Rs5kHLAForYts= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from DB9PR08MB7179.eurprd08.prod.outlook.com (2603:10a6:10:2cc::19) by VE1PR08MB5871.eurprd08.prod.outlook.com (2603:10a6:800:1ae::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.29; Mon, 23 Oct 2023 12:28:35 +0000 Received: from DB9PR08MB7179.eurprd08.prod.outlook.com ([fe80::7279:cb15:78e8:3831]) by DB9PR08MB7179.eurprd08.prod.outlook.com ([fe80::7279:cb15:78e8:3831%5]) with mapi id 15.20.6907.028; Mon, 23 Oct 2023 12:28:35 +0000 Date: Mon, 23 Oct 2023 13:28:19 +0100 From: Szabolcs Nagy To: "Richard Earnshaw (lists)" , gcc-patches@gcc.gnu.org, Kyrylo.Tkachov@arm.com, richard.sandiford@arm.com Subject: Re: [PATCH 10/11] aarch64: Fix branch-protection error message tests Message-ID: References: <711459e210437af7580296f5bff2ef72b6039e7c.1692699125.git.szabolcs.nagy@arm.com> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: LO3P265CA0032.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:387::15) To DB9PR08MB7179.eurprd08.prod.outlook.com (2603:10a6:10:2cc::19) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DB9PR08MB7179:EE_|VE1PR08MB5871:EE_|AMS0EPF0000019E:EE_|AS8PR08MB9477:EE_ X-MS-Office365-Filtering-Correlation-Id: 1de6bef5-e121-4586-8ddc-08dbd3c39900 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 4disQgAFi5PposjXX01AxyIyst6h/VZKnD1YQVCSkMlRPGh7ClX7JaeGElu9NkkxNA572cu4RXRleY1GDqH64a48XZSm3CIOgdS00gIOGwyp63wDM5GZVTsrcWf3CQ4rFTJDYL/lNdPRnLNzmSedYgYtk/XRMpO22HESeq0wxGPuY14Pmu4ll7hlmDo31CsOrZYfSgG85BGTtkUgeMQZfR+TZKKj7wKMj+6sA4goPBQomW/IRK425HEBli4bhyE+4PWjk8kN5GFIKuWh16jySm1sHdVdGfwUoEy6vvjaPOJOghGTjqg+VaWc71uSdUburtTugExipbNGLPd9qLyFjj7FlwYFBQx9jBxOInPJ3iA08kjz6s5IkXnqKotUSAk1NLfn5R6slx8U7KsLOzH2iPPekUhSUYUZZ7ExCEMnl8jrWRL8bFuqZ34trEeoM1BPLrqbMRu4KDiVAyHe2QW5YM+ZTxTClclcSi+inujt8pSpUjBtg61SiafAOr5inYMIbq4RebZ0mCp0iuKmvauRGek421lvTJt0F0Ou852kgxkQorn1ssdHw8l665cEdtUaXYrcCyQlVq6/ONVbCLVdpqPP2R9wZMS1X7kTO39tze4= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB9PR08MB7179.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(396003)(366004)(376002)(346002)(136003)(39850400004)(230922051799003)(186009)(451199024)(1800799009)(64100799003)(2906002)(38100700002)(316002)(6636002)(66946007)(66556008)(2616005)(66476007)(6506007)(6666004)(478600001)(53546011)(6486002)(6512007)(83380400001)(36756003)(44832011)(41300700001)(5660300002)(86362001)(15650500001)(8676002)(8936002)(26005)(67856001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5871 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AMS0EPF0000019E.eurprd05.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 9d0b53e5-c843-4739-fcbb-08dbd3c39376 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NfLprjw2YFoqIZyAbe/NJwEmxqXpyYxCVy5bNzVVowMIbNwQvZddkoqNv88jLY6XTlXBHrVcKdO/S3uE+3a0+sCE1iqdrUrWypgD/dI5fVvyaPwMIQCmAsEpbW16sdoUgEg40o7+pBKtKL54p3073C+pmuW/mcbOi0QtkXrQLqD8L1we2nLRteR0Bh4MPAYcfJlXHCmbJ/my4OazdN2IymtzririAB+dtkM8KKTAjKw+VfqXZxXfX1ymDepAeukL1NQxYtgnwKwPBXGXRsQukBo0B2NfZOs0EtK9d2A3E22XwSp2jcwMg5Obsg9UBIFqXLU6rUbl0JH62hxvVypZkiLElbtOZ7pk9Xx2YqYEk40C72MGCE/Ab852u19ojF0bt2TiXpwJBDWj6uJs9GfhRBKIw8z9Xhxgi+CrpWUWEzpwySdEkblz/u027JmwwO2S+JhLw2nYJwatrrNaNt1JioopSIMApCqtcv2CvLgd406PW85Hc1Vak7aWvHiGxBd2U9e6UqGwBicKEvdjkeUsVck8eTPwwMrLArW4eRxX+VpsscxLxAqMOlQE+7R36FCj1621vVdlHj7oDWpjZ2pzoq9x5f159ZjGvhuvCesfT8fGN6v27PJLpZZ8u1W50VMHCdea6lPpqjUKjgIKzbvrK82ce3iicxsKcwkK5yLTF9lmeY+J0KTd2cweX+O3Yg6bsmVANak/ds5rtl/Wge4HfgjWG9mQXXW3Gx6MfGJQVj5MyVgkVMpJw7H6htO6R+GXWiAkfbln8fMq/Co/Js16dA== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230031)(4636009)(396003)(39860400002)(346002)(136003)(376002)(230922051799003)(186009)(451199024)(1800799009)(82310400011)(64100799003)(46966006)(40470700004)(36840700001)(2906002)(316002)(478600001)(70206006)(70586007)(81166007)(2616005)(6636002)(356005)(82740400003)(6506007)(6666004)(40480700001)(53546011)(6486002)(47076005)(6512007)(336012)(83380400001)(36756003)(36860700001)(5660300002)(40460700003)(44832011)(41300700001)(86362001)(15650500001)(8676002)(8936002)(26005)(67856001);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2023 12:28:44.1622 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1de6bef5-e121-4586-8ddc-08dbd3c39900 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AMS0EPF0000019E.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB9477 X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,KAM_DMARC_NONE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,TXREP,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: The 10/13/2023 11:29, Richard Earnshaw (lists) wrote: > On 05/09/2023 16:00, Richard Sandiford via Gcc-patches wrote: > > Szabolcs Nagy writes: > >> @@ -4,19 +4,19 @@ void __attribute__ ((target("branch-protection=leaf"))) > >> foo1 () > >> { > >> } > >> -/* { dg-error {invalid protection type 'leaf' in 'target\("branch-protection="\)' pragma or attribute} "" { target *-*-* } 5 } */ > >> +/* { dg-error {invalid argument 'leaf' for 'target\("branch-protection="\)'} "" { target *-*-* } 5 } */ > >> /* { dg-error {pragma or attribute 'target\("branch-protection=leaf"\)' is not valid} "" { target *-*-* } 5 } */ > > 'leaf' is really a modifier for the other branch protection strategies; perhaps it would be better to describe it as that. this error message is used for arbitrary strings, e.g. branch-protection=foobar or branch-protection=bti+foo. with further processing we can figure out that 'leaf' is a valid modifier for pac-ret and change the error to invalid placement of modifier 'leaf' in 'target("branch-protection=")' otherwise fall back to invalid argument 'foobar' for 'target("branch-protection=")'. does that help? (currently 'leaf' and 'b-key' are the only modifiers.) > But this brings up another issue/question. If the compiler has been configured with, say, '--enable-branch-protection=standard' or some other variety, is there (or do we want) a way to extend that to leaf functions without changing the underlying strategy? there are several limitations in branch-protection handling, i'm only fixing bugs and assumptions that don't work when arm and aarch64 has different set of branch-protection options. i think it can be useful to add/remove branch-protection options incrementally in cflags instead of having one string, but it's not obvious to me how to get there. > >> void __attribute__ ((target("branch-protection=none+pac-ret"))) > >> foo2 () > >> { > >> } > >> -/* { dg-error "unexpected 'pac-ret' after 'none'" "" { target *-*-* } 12 } */ > >> +/* { dg-error {argument 'none' can only appear alone in 'target\("branch-protection="\)'} "" { target *-*-* } 12 } */ > > Or maybe better still: "branch protection strategies 'none' and 'pac-ret' are incompatible". i can make this change, but e.g. in case of branch-protection=standard+bti+foo it would say "'standard' and 'bti' are incompatible" which can be surprising given that standard includes bti, meanwhile "'standard' can only appear alone" explains the problem. > But this is all a matter of taste. > > However, this patch should be merged with the patch that changes the error messages. Or has that already gone in? i can do that merge.