From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2074.outbound.protection.outlook.com [40.107.21.74]) by sourceware.org (Postfix) with ESMTPS id CBCF73858012 for ; Wed, 15 Nov 2023 17:08:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CBCF73858012 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 CBCF73858012 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.21.74 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1700068136; cv=pass; b=I2xIFHbVaIvbAqHyHvjUPnsFJHfA3fkTua5qRxYTGuUYqaaw1nZsZy822aO9DkgFp+VXFygwIXz700fDkwKPcJBWVw4utIgIIZR8h+fEHqsJT0wxsL8HMlsqNC/MLE6JUf8yjtzqg9cXvZu2jadCTIaTIujTj83Fq28GYsiXThE= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1700068136; c=relaxed/simple; bh=5B0LRRS8TwsOU4kT3djJ5rwAnGAO6wdxaY3xk2fSdYI=; h=DKIM-Signature:DKIM-Signature:Date:From:To:Subject:Message-ID: MIME-Version; b=wKtC7hDmK6GI2OJcKrf5fyBjxOB/ZEobdV/5oSrSmI7o5ugffOH4ti/tzL0wAcy78maCmaYXTsWdZ5Huba71SkDTqtpQb/j6DR0m5y2r+NZcmUng5JbHn8v8JOmwBbaCWf0rqQHgj4H1gaqkD/xraLpcbJs87PEKDaSoNnmu0yE= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=AHNI50PuhAK3Ud90OYDtKp0lHx2dKL1pb3wRsWRf7ttSV5OTRaClwUCklpWApn6Qp0U90H6jyM7HCITHbmdFKoNuM7r4FmNG917zpD87Nr70NXdJ1l/KVKjcziVqVwUl+y9wgMYLi5ncQ8C2CurO9Enig2jTsrRU+39tZaZujVksQVl1W9yCaCpaWuFeXlLcc/I8/Um/OoL0BcqxCWyW1lq2w7BULCXLJvzmZl70a0rHUuxXau6fIkG0SvZmyr26dDOqKDzM6bHQ6NDDuXoq8UeiNUuBH+EwBpiP+G+52LyWC2d07Yt2l145AdBb5/EoQoDdQ1XFenl28wh2sE29pg== ARC-Message-Signature: i=2; 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=zA1Gb+EGJpTD48qhPMslJFaup2++ILuxiu6MweB3nEM=; b=Pr6IiNK+eWj+A7pyekoXVAdvCdTUN99RxokWZTRxSGx+hAw5Gtmxsg7vqojEZx5D7psklsdW5JKCACgIsBXFVxo9Ty2vxgDBggFJSVX790s4nUI0fr0MIXogkmaiDveNamwPzMutmvAnv+usYuB64eMLspNCPnqlS7L2ZwRyDmMivTS+ZbMnD8PJ7mKunPJLJWTCQjewkOU7d7WOpkFBjtn9PBpRCEryaHoycfVKLayz20DsBn65+eVO0Xn0Tce3lDYzaI5nsIaXY2Gpb5ZvElP6d4F2z8S8WXEHYC40TzwjdYeHNmIgkBeHmhgZA34QTjpMg65eeo/Ug1pO4I4O6Q== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=gcc.gnu.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) 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=zA1Gb+EGJpTD48qhPMslJFaup2++ILuxiu6MweB3nEM=; b=RiVAcyi42Y4xBq5i4+kEMTFWjluW7jGJ4OWmUhT/8qyNBYXLjLok7W29bgmHwRerA1RM99jFR+bIdmgjBrOAWSq0NEriPHrcGKl0TzwFyQZyn27PV5cIcaUoF6J9Asy8cd6nLBcxUbUQPn+zG3TYb5R34V+Kmk0pCBNfDdQ7C+U= Received: from DUZP191CA0025.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:4f8::21) by VI1PR08MB9983.eurprd08.prod.outlook.com (2603:10a6:800:1c8::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.29; Wed, 15 Nov 2023 17:08:48 +0000 Received: from DU6PEPF00009529.eurprd02.prod.outlook.com (2603:10a6:10:4f8:cafe::4b) by DUZP191CA0025.outlook.office365.com (2603:10a6:10:4f8::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7002.18 via Frontend Transport; Wed, 15 Nov 2023 17:08:48 +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 DU6PEPF00009529.mail.protection.outlook.com (10.167.8.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7002.14 via Frontend Transport; Wed, 15 Nov 2023 17:08:48 +0000 Received: ("Tessian outbound 26ee1d40577c:v228"); Wed, 15 Nov 2023 17:08:48 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 0e606b5adfc43f88 X-CR-MTA-TID: 64aa7808 Received: from 8e8fbe0c7b29.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id CC0FDB6E-B904-4CFC-B5B6-98CAB71C59DD.1; Wed, 15 Nov 2023 17:08:41 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 8e8fbe0c7b29.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 15 Nov 2023 17:08:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RvnY7it5ppxPyUQvh9yLfEvV1eJhpzydgqMPCLdlI5qrKnisdc5y0mN46AQSulLXTo/0un1TnyqYkPy5laz3Mnrq4PtxUDnAnhOZwxMoz30DplM6CUoJUpJR/y30O932OKkPr/jFdWEu0QmDwQcg82408XZKGUCgwqjyjGBeBBpJWAbJkv31HcEwQZpASezRLhi8BcDft6g5OGDFGyJBZ+0C7z6/3eq7Gv0VM3WTX+ezjl99Acdr4Tr7zAqHfPVZ6fWtccLG/WxnOD9rb6/0cwf1ieP1t3veY0fcnIe8CIighkgrH2lyWBRiGO5pOx3J4tkD+pUqLc/LaTe+54yXPQ== 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=zA1Gb+EGJpTD48qhPMslJFaup2++ILuxiu6MweB3nEM=; b=kTWUcgye9/4m75oUSlyZq4wDfvoEw+QoR0R1c7v0TVBlLt0k6vu9rt9Iqxb3KkkqFa4B+2jlgU62+AHbg1cquhz5SrxQ+tHlJLFSZhTR/CQAVV5m/vNeZXxMFSxyoF3VqehF5x4nhJslNX4SHfDv49F9EZWAmNZvtN1ZzlYrBnECkKrv+aYaSCrrcj0vRAGZrt9utLe6QAEw5Z9Usgj0Kto+FrTxUwehCR4jhG2GVYJnrkm+aH1Z+8FqncTLDXULtpwIrr0V7hd+zZcfmxge0dbXT1Yn1U2SweJq/p1LRVtBZkJd9vqm7T42tTOH8K0wZ2FSEDE1z2MUJxwWEPC1gA== 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=zA1Gb+EGJpTD48qhPMslJFaup2++ILuxiu6MweB3nEM=; b=RiVAcyi42Y4xBq5i4+kEMTFWjluW7jGJ4OWmUhT/8qyNBYXLjLok7W29bgmHwRerA1RM99jFR+bIdmgjBrOAWSq0NEriPHrcGKl0TzwFyQZyn27PV5cIcaUoF6J9Asy8cd6nLBcxUbUQPn+zG3TYb5R34V+Kmk0pCBNfDdQ7C+U= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from VI1PR08MB5325.eurprd08.prod.outlook.com (2603:10a6:803:13e::17) by PAVPR08MB9040.eurprd08.prod.outlook.com (2603:10a6:102:32d::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7002.18; Wed, 15 Nov 2023 17:08:38 +0000 Received: from VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::9679:2ab0:99c6:54a3]) by VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::9679:2ab0:99c6:54a3%6]) with mapi id 15.20.6977.029; Wed, 15 Nov 2023 17:08:38 +0000 Date: Wed, 15 Nov 2023 17:08:34 +0000 From: Tamar Christina To: gcc-patches@gcc.gnu.org Cc: nd@arm.com, Richard.Earnshaw@arm.com, Marcus.Shawcroft@arm.com, Kyrylo.Tkachov@arm.com, richard.sandiford@arm.com Subject: [PATCH 6/6]AArch64: only emit mismatch error when features would be disabled. Message-ID: Content-Type: multipart/mixed; boundary="0jnLxU+6VwtUnBf/" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-ClientProxiedBy: LO6P123CA0055.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:310::12) To VI1PR08MB5325.eurprd08.prod.outlook.com (2603:10a6:803:13e::17) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB5325:EE_|PAVPR08MB9040:EE_|DU6PEPF00009529:EE_|VI1PR08MB9983:EE_ X-MS-Office365-Filtering-Correlation-Id: 100a5898-80c0-448a-3adc-08dbe5fd88a0 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: 0+gZQlmq2RxsaxkrRArIC+t+A79FiA/3NYbjsrEwSSdxARCLHilzg3hCXjXlzyu6Ph0vhUp9gXnC0iGNAjGhyHXBreQp5irpmNd2/drjvGfxVePWSYsA48FESgCKT/EXLEV+plr3JHjaPpYTI0anJ/Df7vNF4QXbEmEenUkHaMkbFW6e7Y3nDna+LlOqI2j0t5FaFCyoAARZCtZaHs/zgssIP6GGHM6fsez6XF7iMNzaLezkUO4JMAjxB2ti1clyO7jNQkydRprLcpvhYsa1tbJma2WJ6Il4JEnBgGdMmdKWtagT1tHFLMmK2qTcOgSui2f89W408LZgFEU4XBEDnVhcokTL966jqmon9RCPKD77uWWjW3tF2G/H+I5uvLMCc5GqMDykAOaYxb5hMoG1dLQK60ShUITC+cUYv5yVmsw5Gvz09JvrEvEqgwmFOeuNaV0mVJ1QsfWwoN0YJtQaRFHG2KLVAjW1d9vF3PhIdMuOK9iVTAvCXbN3a84x0BYgMOcJdTQZTSVGWLZ2/uIPOw/Cii/5p2YYrGU2uAjqg/t56kd76RLbweGR4jKKYnYLXRZjjx9bxOXtfSSgmAFZcKjy7I/SJKx8Qr6YP2yJAMxHA4x2TVjlGEYYd+SNif8gxmNUBIMkQhP8XRhw91NYI8nAaeEVCXfIz7qObH0kx+WBHrBgzdtpL86uxJUQf776 X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR08MB5325.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(39860400002)(396003)(346002)(366004)(376002)(136003)(230173577357003)(230922051799003)(230273577357003)(64100799003)(451199024)(1800799009)(186009)(83380400001)(2616005)(235185007)(26005)(478600001)(6666004)(6506007)(5660300002)(6512007)(4743002)(2906002)(8936002)(8676002)(4326008)(33964004)(44832011)(44144004)(316002)(41300700001)(38100700002)(6486002)(66476007)(66556008)(66946007)(6916009)(36756003)(86362001)(67856001)(2700100001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR08MB9040 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: DU6PEPF00009529.eurprd02.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 6dfc82ca-318e-4820-a5ca-08dbe5fd82cb X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cfrgmDX0NcCXGBJcikgwzaXSJS1T8rcZCzdwozkyHokl7vQwTnwLnRkEy2wdSgRIA3MOOPSdhK9SoQIVo70IM1kxeFCvMRH9WnkqZZyU7br+rcsOXKeF8YpAaitIlkWD+bEgCMVAq1kx0TA8VtGaMha0h8ZDqqQ8t/xez5NHw10pTnCumCRosmaKgNVAIGrlGouNlDu4TZdrV4VegjbXBRZAk7eD7iisJOf5GpVuhTHLW3yXTBr47KXeyDB8uavUnFOTo2oi2QytvmziCK82H/oAVbuKRpGwbFDZ8jkH43ebrw0y9JrecoW3XM+oHzxFCLCoWsMW0isRUOK2jhwT2lnMUHihO7fyoY2pgV/Na6SWt1/8/pwAqbVfZ/2J3gT2qN8y3vwIjMB3q4RLiX53kxP5pxPdgVLBlON9cLDR8CP3pbZHISbS3zsyzl5HY9/nBfIzj5Svzt6Ekufg6QVM5iaMMI0UnyBcueacXlgSiLnKAgGnV6fKn2RzAdQ9f57Bk3EMjYPLx+hKQId4nQKPxXdGi5UtY44DdsGarZM/yaFJtc2k2Cp6H0iJTB/ERfUZelJO3sTj924QhrfWAvBFScivIfl5eguaU1DbtJrHQe60VYd2+wyzkep9DVfsLILyZK69RIe5LH9TRKwt/IhmXOnMhqAEHdsAMi/BY7E0fx+BZ4BB+WbMNlq5s7FDSTc2PUG8aB/mHqeuliUSMLwO+zvsseE+VbD8yg0BdQYgQLD7i2dPaxVNLFK+0ENyPLXRnyzU94f+Qne7bVaFpQbfzU5eGMrkXbsK7DiMEWMOieKXYOr6GtVoGg9PO2q9FZsH8SPHiWDyv4/veovTG8w6hQ== 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)(376002)(136003)(39850400004)(346002)(230273577357003)(230922051799003)(230173577357003)(1800799009)(451199024)(82310400011)(186009)(64100799003)(36840700001)(46966006)(40470700004)(4326008)(40480700001)(26005)(40460700003)(70586007)(356005)(81166007)(82740400003)(70206006)(86362001)(6916009)(36756003)(336012)(83380400001)(6512007)(2616005)(6666004)(4743002)(36860700001)(33964004)(6506007)(47076005)(478600001)(44832011)(2906002)(44144004)(316002)(6486002)(5660300002)(8936002)(235185007)(8676002)(41300700001)(67856001)(2700100001);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Nov 2023 17:08:48.4433 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 100a5898-80c0-448a-3adc-08dbe5fd88a0 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: DU6PEPF00009529.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB9983 X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,GIT_PATCH_0,KAM_DMARC_NONE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY 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: --0jnLxU+6VwtUnBf/ Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit Hi All, At the moment we emit a warning whenever you specify both -march and -mcpu and the architecture of them differ. The idea originally was that the user may not be aware of this change. However this has a few problems: 1. Architecture revisions is not an observable part of the architecture, extensions are. Starting with GCC 14 we have therefore relaxed the rule that all extensions can be enabled at any architecture level. Therefore it's incorrect, or at least not useful to keep the check on architecture. 2. It's problematic in Makefiles and other build systems, where you want to for certain files enable CPU specific builds. i.e. you may be by default building for -march=armv8-a but for some file for -mcpu=neoverse-n1. Since there's no easy way to remove the earlier options we end up warning and there's no way to disable just this warning. Build systems compiling with -Werror face an issue in this case that compiling with GCC is needlessly hard. 3. It doesn't actually warn for cases that may lead to issues, so e.g. -march=armv8.2-a+sve -mcpu=neoverse-n1 does not give a warning that SVE would be disabled. For this reason I have one of two proposals: 1. Just remove this warning all together. 2. Rework the warning based on extensions and only warn when features would be disabled by the presence of the -mcpu. This is the approach this patch has taken. As examples: > aarch64-none-linux-gnu-gcc -march=armv8.2-a+sve -mcpu=neoverse-n1 cc1: warning: switch ‘-mcpu=neoverse-n1’ conflicts with ‘-march=armv8.2-a+sve’ switch and resulted in options +crc+sve+norcpc+nodotprod being added .arch armv8.2-a+crc+sve > aarch64-none-linux-gnu-gcc -march=armv8.2-a -mcpu=neoverse-n1 > aarch64-none-linux-gnu-gcc -march=armv8.2-a+dotprod -mcpu=neoverse-n1 > aarch64-none-linux-gnu-gcc -march=armv8.2-a+dotprod -mcpu=neoverse-n2 The one remaining issue here is that if both -march and -mcpu are specified we pick the -march. This is not particularly obvious and for the use case to be more useful I think it makes sense to pick the CPU's arch? I did not make that change in the patch as it changes semantics. Bootstrapped Regtested on aarch64-none-linux-gnu and no issues. Note that I can't write a test for this because dg-warning expects warnings to be at a particular line and doesn't support warnings at the "global" level. Ok for master? Thanks, Tamar gcc/ChangeLog: * config/aarch64/aarch64.cc (aarch64_override_options): Rework warnings. --- inline copy of patch -- diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc index caf80d66b3a744cc93899645aa5f9374983cd3db..3afd222ad3bdcfb922cc010dcc0b138db29caf7f 100644 --- a/gcc/config/aarch64/aarch64.cc +++ b/gcc/config/aarch64/aarch64.cc @@ -16388,12 +16388,22 @@ aarch64_override_options (void) if (cpu && arch) { /* If both -mcpu and -march are specified, warn if they are not - architecturally compatible and prefer the -march ISA flags. */ - if (arch->arch != cpu->arch) - { - warning (0, "switch %<-mcpu=%s%> conflicts with %<-march=%s%> switch", + feature compatible. feature compatible means that the inclusion of the + cpu features would end up disabling an achitecture feature. In + otherwords the cpu features need to be a strict superset of the arch + features and if so prefer the -march ISA flags. */ + auto full_arch_flags = arch->flags | arch_isa; + auto full_cpu_flags = cpu->flags | cpu_isa; + if (~full_cpu_flags & full_arch_flags) + { + std::string ext_diff + = aarch64_get_extension_string_for_isa_flags (full_arch_flags, + full_cpu_flags); + warning (0, "switch %<-mcpu=%s%> conflicts with %<-march=%s%> switch " + "and resulted in options %s being added", aarch64_cpu_string, - aarch64_arch_string); + aarch64_arch_string, + ext_diff.c_str ()); } selected_arch = arch->arch; -- --0jnLxU+6VwtUnBf/ Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="rb17820.patch" diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc index caf80d66b3a744cc93899645aa5f9374983cd3db..3afd222ad3bdcfb922cc010dcc0b138db29caf7f 100644 --- a/gcc/config/aarch64/aarch64.cc +++ b/gcc/config/aarch64/aarch64.cc @@ -16388,12 +16388,22 @@ aarch64_override_options (void) if (cpu && arch) { /* If both -mcpu and -march are specified, warn if they are not - architecturally compatible and prefer the -march ISA flags. */ - if (arch->arch != cpu->arch) - { - warning (0, "switch %<-mcpu=%s%> conflicts with %<-march=%s%> switch", + feature compatible. feature compatible means that the inclusion of the + cpu features would end up disabling an achitecture feature. In + otherwords the cpu features need to be a strict superset of the arch + features and if so prefer the -march ISA flags. */ + auto full_arch_flags = arch->flags | arch_isa; + auto full_cpu_flags = cpu->flags | cpu_isa; + if (~full_cpu_flags & full_arch_flags) + { + std::string ext_diff + = aarch64_get_extension_string_for_isa_flags (full_arch_flags, + full_cpu_flags); + warning (0, "switch %<-mcpu=%s%> conflicts with %<-march=%s%> switch " + "and resulted in options %s being added", aarch64_cpu_string, - aarch64_arch_string); + aarch64_arch_string, + ext_diff.c_str ()); } selected_arch = arch->arch; --0jnLxU+6VwtUnBf/--