From patchwork Thu Oct 12 14:24:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tamar Christina X-Patchwork-Id: 1847489 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=armh.onmicrosoft.com header.i=@armh.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-armh-onmicrosoft-com header.b=cxKgEZkz; dkim=pass (1024-bit key) header.d=armh.onmicrosoft.com header.i=@armh.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-armh-onmicrosoft-com header.b=cxKgEZkz; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S5sNJ3LXnz1yqj for ; Fri, 13 Oct 2023 01:24:48 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 44C0838582BC for ; Thu, 12 Oct 2023 14:24:46 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2050.outbound.protection.outlook.com [40.107.7.50]) by sourceware.org (Postfix) with ESMTPS id E68313858C30 for ; Thu, 12 Oct 2023 14:24:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E68313858C30 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=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=pNIb3vG8XVvaNc8j/av/cYmWXWO67aj40mMISwCFl/U=; b=cxKgEZkzscdpwJQcFymg6z7tIoeQIV6XtvdVHedV50h7gfIspOkQAloOwkvA5swFC162WjTMGmctuZf8Fpfb4RUGwSyko6tPHFLpDbrApSwO3Hep+vILPvS18wYnyqopYwrpbxp6gZPnPHFGm+Fi6cEA02NwOWGRMOHAflez438= Received: from AM6PR01CA0044.eurprd01.prod.exchangelabs.com (2603:10a6:20b:e0::21) by GV1PR08MB7707.eurprd08.prod.outlook.com (2603:10a6:150:52::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.36; Thu, 12 Oct 2023 14:24:24 +0000 Received: from AM7EUR03FT043.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:e0:cafe::d9) by AM6PR01CA0044.outlook.office365.com (2603:10a6:20b:e0::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.30 via Frontend Transport; Thu, 12 Oct 2023 14:24:24 +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 AM7EUR03FT043.mail.protection.outlook.com (100.127.140.160) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.31 via Frontend Transport; Thu, 12 Oct 2023 14:24:24 +0000 Received: ("Tessian outbound 9aeaca65ec26:v211"); Thu, 12 Oct 2023 14:24:24 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: d6bf656a7217a653 X-CR-MTA-TID: 64aa7808 Received: from 21b4031f1100.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 4B9B452C-B54F-458D-8737-5DAD67BE30B9.1; Thu, 12 Oct 2023 14:24:10 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 21b4031f1100.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 12 Oct 2023 14:24:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CcqrYveGGJVutZ7wdFo/gb3RONz8ESnHUFdOJIiTDA1Dk/UXWFR0jJiZJlweLxGJjEOcDdkXterk9zMxOWwj9IB/BIw0MtR7oiCytvOtveMiMWMn3YrSr8kXdBn95GdTZflkE3xQKdh/xxR23hk211CjSwDr0HVby46ouupmqa6ZmfQzqXO/9w+8vywW6X0Gh3zE6/V8fK0tV+i6RFq9NpkJTehNm8fcLzPacZRiUFhw2ujNuqKjtEk1//M1ERB8w9I0527npDefhTCPhC/e1dmsFYXEzSsMTGxgxJlNjaFjLb5GFn/h8Yz6iDLXaYui+mPw8qAuBBNqMXi+w0H/TA== 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=pNIb3vG8XVvaNc8j/av/cYmWXWO67aj40mMISwCFl/U=; b=gmPLN+Du85Iq6bhkre/ESrO31x2SD2yE3JA5fVruNHvNpxsOlZo5BVElxHUlv+dfOREa8Fx5AOlVn2JBtIDxL4QEtp7M5RCMxn/DaTCjHHE8ItgLmsIiE8Z3xGuic5TdZbfFeq5NUMWTBzF2LG699uXBDJAwp/dG7urJ58Tvm7cHYQoelCOOiStsZxxP4oVfY5/YuYn8HRsL3Qg+g4oQsUM3UjCO4QekfDZXM5hbADx/zIl1z3ldN8D7jaxCj1I53vJ6FlAoRNeaeYlkhIjozV68TsNtZKIktkCsYzYgk4nwvEq575QC3HykCXIWsBJt5Ii1V0TGA+m8dsqh83Xd5g== 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=pNIb3vG8XVvaNc8j/av/cYmWXWO67aj40mMISwCFl/U=; b=cxKgEZkzscdpwJQcFymg6z7tIoeQIV6XtvdVHedV50h7gfIspOkQAloOwkvA5swFC162WjTMGmctuZf8Fpfb4RUGwSyko6tPHFLpDbrApSwO3Hep+vILPvS18wYnyqopYwrpbxp6gZPnPHFGm+Fi6cEA02NwOWGRMOHAflez438= 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 AM8PR08MB6434.eurprd08.prod.outlook.com (2603:10a6:20b:369::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.42; Thu, 12 Oct 2023 14:24:08 +0000 Received: from VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::bba1:2711:6992:468d]) by VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::bba1:2711:6992:468d%4]) with mapi id 15.20.6863.032; Thu, 12 Oct 2023 14:24:08 +0000 Date: Thu, 12 Oct 2023 15:24:05 +0100 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 5/6]AArch64: Fix Armv9-a warnings that get emitted whenever a ACLE header is used. Message-ID: Content-Disposition: inline X-ClientProxiedBy: LNXP265CA0006.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:5e::18) To VI1PR08MB5325.eurprd08.prod.outlook.com (2603:10a6:803:13e::17) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB5325:EE_|AM8PR08MB6434:EE_|AM7EUR03FT043:EE_|GV1PR08MB7707:EE_ X-MS-Office365-Filtering-Correlation-Id: 95990fd3-eea2-4a68-c139-08dbcb2eef4f 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: 89Ew4+1fblWj/WA4DUIcMpwKoDrdlHbJhXcuNS/uAQiKUo9n1npUftG1no1T7E+aTgLr6bokHgsTAL58eO0KSklXDMt3CjP4FE3tWxlXP2d+vqnieJ6p98M15vlruMTonFCYeBYGnsdkKrAg8THIktEb3CZMjPi9af2RIAryIF1WXBCf9RP2UUPuSWtz8OqgFDdfZKANNtYgrsWIbdh2kw+HGGuIl9UJd1g9DvIcrmb/99TcTieV2SAelYDp6EYlp28dB5QCtvW7Pyt2C5Q+K0/ZwojXeZ2SxUMDo1bcZDyCbgObbrRlb/zw/m4BbEbXHRDGVpEc0CHQmpNaXVQqmwrHjercOp6Qg+LmJNc7OBiYrMzWntzEGFvoD3J7cRY2ZLmE5r+edqDEe2gUyt6MZ04gCGmDcRs0gfPWXpbr1f49+hd0crqAii4IAJghlJ276OsQpvd/ScQtUcpxgKtlPh5lWQnnDeW9RSq4P9o8hQes75nbybW3cuUWndYuf7VaKDDjig1Ti8wX+ul6ZboDfSyq29wDlC/SLjRmIE71zmaGU5yzz/ZkuJ9L2XDlnSQn5RJEJgjfl5oneXb7UuPYXZsJx9tsAYsK1/ljgKX3nzHlu7gv9QCBU1rNLCKU3tDu 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)(366004)(136003)(396003)(376002)(346002)(39860400002)(230922051799003)(186009)(64100799003)(451199024)(1800799009)(36756003)(86362001)(44832011)(235185007)(5660300002)(2906002)(2616005)(4743002)(84970400001)(44144004)(4326008)(478600001)(66556008)(33964004)(83380400001)(26005)(6666004)(66946007)(41300700001)(66476007)(6506007)(6512007)(8676002)(38100700002)(316002)(6916009)(8936002)(6486002)(4216001)(2700100001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB6434 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: AM7EUR03FT043.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 2abf6bca-9a60-4aee-f7fd-08dbcb2ee556 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XwExs2strGOfBlyScIqMfhp+ke0rt+bTjBKJoy/IgZQXiB7Salj3+E3yGHQAqrGFN62kPP3O+og2q03Q9SHjbiJRLdaaSqk5EGxX9JqbFVqvIXXIPw3/X9Xh4LMxdLYQSswqq9r5Ynyo1UZpJgmC9HJ11GqLuBcLYAXiw9Vh9tvYeXQGMjNQ9abkml1Nj1GbLB0jktnbx+C7nU76UiZHf/y00Rdxobgfq6DPOdal8Txu2d+6BdjyPaV0akZo0YujMtkw1Iop6jsdaYXSvKmiQ+Zvs8FmM49nKpPWZBpmYvH0+duyz4pKmirESp4EKXt3R2yWB1Txy8CWsGV5CtS4sPzVFntn/AGFMT+D8Hlt27F5GexiIWHgfHwspi1M/H1A/n/HPv2DvN3s4oqNeo0y2AImgZ3xvdGYDIJQ58BnspabV5fiMzoJpz0ytRAZxDtYVsDbQkZa3LNvcFHD/oIRC4qveG8dHaJoO3qs82T+hCgQz74i0RKvczaiONKc9hTEjvcHzKpu2YsXjne/91b0B/XVR4erZ7bzysX7mJCZqbnai1Vj1F0BMJpJpfuargKzC6lu4D41yPwieKZEm0+onLe5qbBFt4l0SXOHwrM7+GTEumVOJ3YbRkaSVLFBuvm1R8OYdyJ8R9Zs7HMFOMbPzVPtAQjVx9fbM/K71h7cSwVqB2ILE5zzXm5PR96lEBDJcr9be29AA2CgEvkJqjfSIUCb5rCrzf4YCNutd9oJc8IpH3dEtpJ6dh8bNMt214yNnfeItmwJJXcUzRBEaCghum3+WOaR00CHM1ns7z41qYQ= 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)(346002)(39860400002)(396003)(136003)(376002)(230922051799003)(82310400011)(186009)(64100799003)(1800799009)(451199024)(46966006)(40470700004)(36840700001)(336012)(26005)(4743002)(81166007)(2616005)(6512007)(47076005)(8676002)(8936002)(2906002)(6666004)(478600001)(4326008)(235185007)(44832011)(6506007)(70206006)(70586007)(5660300002)(6486002)(316002)(6916009)(41300700001)(40460700003)(82740400003)(356005)(86362001)(40480700001)(36860700001)(36756003)(84970400001)(33964004)(83380400001)(44144004)(4216001)(2700100001); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2023 14:24:24.6347 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 95990fd3-eea2-4a68-c139-08dbcb2eef4f 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: AM7EUR03FT043.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB7707 X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_NONE, KAM_LOTSOFHASH, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Hi All, At the moment, trying to use -march=armv9-a with any ACLE header such as arm_neon.h results in rows and rows of warnings saying: : warning: "__ARM_ARCH" redefined : note: this is the location of the previous definition This is obviously not useful and happens because the header was defined at __ARM_ARCH == 8 and the commandline changes it. The Arm port solves this by undef the macro during argument processing and we do the same on AArch64 for the majority of macros. However we define this macro using a different helper which requires the manual undef. Bootstrapped Regtested on aarch64-none-linux-gnu and no issues. Ok for master? Thanks, Tamar gcc/ChangeLog: * config/aarch64/aarch64-c.cc (aarch64_update_cpp_builtins): Add undef. gcc/testsuite/ChangeLog: * gcc.target/aarch64/armv9_warning.c: New test. --- inline copy of patch -- diff --git a/gcc/config/aarch64/aarch64-c.cc b/gcc/config/aarch64/aarch64-c.cc index 578ec6f45b06347d90f951b37064006786baf10f..ab8844f6049dc95b97648b651bfcd3a4ccd3ca0b 100644 --- diff --git a/gcc/config/aarch64/aarch64-c.cc b/gcc/config/aarch64/aarch64-c.cc index 578ec6f45b06347d90f951b37064006786baf10f..ab8844f6049dc95b97648b651bfcd3a4ccd3ca0b 100644 --- a/gcc/config/aarch64/aarch64-c.cc +++ b/gcc/config/aarch64/aarch64-c.cc @@ -82,6 +82,7 @@ aarch64_update_cpp_builtins (cpp_reader *pfile) { aarch64_def_or_undef (flag_unsafe_math_optimizations, "__ARM_FP_FAST", pfile); + cpp_undef (pfile, "__ARM_ARCH"); builtin_define_with_int_value ("__ARM_ARCH", AARCH64_ISA_V9A ? 9 : 8); builtin_define_with_int_value ("__ARM_SIZEOF_MINIMAL_ENUM", diff --git a/gcc/testsuite/gcc.target/aarch64/armv9_warning.c b/gcc/testsuite/gcc.target/aarch64/armv9_warning.c new file mode 100644 index 0000000000000000000000000000000000000000..35690d5bce790e11331788aacef00f3f35cdf216 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/armv9_warning.c @@ -0,0 +1,5 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-march=armv9-a -Wpedantic -Werror" } */ + +#include + --- a/gcc/config/aarch64/aarch64-c.cc +++ b/gcc/config/aarch64/aarch64-c.cc @@ -82,6 +82,7 @@ aarch64_update_cpp_builtins (cpp_reader *pfile) { aarch64_def_or_undef (flag_unsafe_math_optimizations, "__ARM_FP_FAST", pfile); + cpp_undef (pfile, "__ARM_ARCH"); builtin_define_with_int_value ("__ARM_ARCH", AARCH64_ISA_V9A ? 9 : 8); builtin_define_with_int_value ("__ARM_SIZEOF_MINIMAL_ENUM", diff --git a/gcc/testsuite/gcc.target/aarch64/armv9_warning.c b/gcc/testsuite/gcc.target/aarch64/armv9_warning.c new file mode 100644 index 0000000000000000000000000000000000000000..35690d5bce790e11331788aacef00f3f35cdf216 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/armv9_warning.c @@ -0,0 +1,5 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-march=armv9-a -Wpedantic -Werror" } */ + +#include +