From patchwork Fri Jun 18 15:22:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinath Parvathaneni X-Patchwork-Id: 1494323 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=uSW1ZcIc; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G62mn505Hz9sCD for ; Sat, 19 Jun 2021 01:25:29 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 304DD3AA9C32 for ; Fri, 18 Jun 2021 15:25:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 304DD3AA9C32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1624029927; bh=pgJl0TNg5arB6yZGkDc8SWhTKjsUrjnEHfPSCqAr/GM=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=uSW1ZcIcJXS/D2Ipk0j94BX8HIJjVlFUddpwEp/BDTL7uzA4tfva9lzr4gTdzJTq+ 5yZuiZ0tihC6JsukTjsWEnWRbYZlnXaW6p8mBBGc3FP01YICOoJ6qA5C+ogzbmu/bN +QddCtf4/3Xo7m747C48TjSFm1BAooHfO0TNXJZQ= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60060.outbound.protection.outlook.com [40.107.6.60]) by sourceware.org (Postfix) with ESMTPS id 42AD03AAA01B for ; Fri, 18 Jun 2021 15:24:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 42AD03AAA01B Received: from PR2PR09CA0002.eurprd09.prod.outlook.com (2603:10a6:101:16::14) by DBBPR08MB4394.eurprd08.prod.outlook.com (2603:10a6:10:d0::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.21; Fri, 18 Jun 2021 15:24:32 +0000 Received: from VE1EUR03FT005.eop-EUR03.prod.protection.outlook.com (2603:10a6:101:16:cafe::6c) by PR2PR09CA0002.outlook.office365.com (2603:10a6:101:16::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.15 via Frontend Transport; Fri, 18 Jun 2021 15:24:32 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; gcc.gnu.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;gcc.gnu.org; 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; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT005.mail.protection.outlook.com (10.152.18.172) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.16 via Frontend Transport; Fri, 18 Jun 2021 15:24:31 +0000 Received: ("Tessian outbound 7f55dcc5b33a:v96"); Fri, 18 Jun 2021 15:24:31 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 51ebc0b86b6c28f7 X-CR-MTA-TID: 64aa7808 Received: from af3bf6e4f692.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 0E2CA3B1-3159-4711-A7F0-24D9305E6D86.1; Fri, 18 Jun 2021 15:24:19 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id af3bf6e4f692.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 18 Jun 2021 15:24:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i0upqaPk7PLekm5x3A7jit7ufcLEbSM0y93UwZQB/FAQnIjXfcaspEYLZhZXERxeCLR3eLUzDNOXvEP8RkvlRd0z4pGaXo6Uz11smhFRV0DlJHva47cbLSWVyJx087NNISA8PpMY2tsDXFUU7JbYuz/mQx7NrhWm20/Mk3dPG1ZTzN5dGjpPAZdvQHwJCcbZme2wnd2aqNWCooiRVbJ6B4lxhpToO+anzukwX4/LH+APjh5IUpHyj0edn+f6CMRgjDEXSvX+WI6FQsKGoe/xXnsU/pqGqAzIHSygFS8Im316cl3uFhPIq+ccn3bSzglNcobafqcGVLOOltucWFANGg== 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-SenderADCheck; bh=pgJl0TNg5arB6yZGkDc8SWhTKjsUrjnEHfPSCqAr/GM=; b=VswZb07Flb/LcQQRVcubybIXYwERePv+2bO4vZMT/kVB/y6bs7CcCENN8J4NGMDaXbuSBo3B3zjil6/i2nxBXdA79tQf6MKKddO1PWEuKoJ44fuOT9IrhZJkAfHHVPCKqprtgKGvtooyuxXIY1WeWfWX2zoZsD/qP2RvFRhxaSCOs/M5r8qskzBs6qoWT8J2+wLZrziMdxGJc7/XsE4Bfamgc+HsqkqFlGbG2bm6gPTc1+P5AsI0kp+TloZg+rtshww48xofEMjev9vr7Rkc3s8ljeWIk2M/GLkGq4P05sFmjeSW5gg1fDSGVUt3cVamhyJJTrV0pVjJ+vejcecoHg== 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 Authentication-Results-Original: gcc.gnu.org; dkim=none (message not signed) header.d=none;gcc.gnu.org; dmarc=none action=none header.from=arm.com; Received: from VI1PR0802MB2368.eurprd08.prod.outlook.com (2603:10a6:800:9d::10) by VI1PR08MB3376.eurprd08.prod.outlook.com (2603:10a6:803:7a::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.21; Fri, 18 Jun 2021 15:24:16 +0000 Received: from VI1PR0802MB2368.eurprd08.prod.outlook.com ([fe80::44e5:2f6b:2aa1:ff11]) by VI1PR0802MB2368.eurprd08.prod.outlook.com ([fe80::44e5:2f6b:2aa1:ff11%11]) with mapi id 15.20.4242.018; Fri, 18 Jun 2021 15:24:16 +0000 Date: Fri, 18 Jun 2021 16:22:10 +0100 To: gcc-patches@gcc.gnu.org Subject: [PATCH][GCC-10] arm: Fix multilib mapping for CDE extensions [PR100856]. X-Originating-IP: [217.140.106.52] X-ClientProxiedBy: LO4P123CA0475.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1a8::12) To VI1PR0802MB2368.eurprd08.prod.outlook.com (2603:10a6:800:9d::10) Message-ID: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from e120703-lin.cambridge.arm.com (217.140.106.52) by LO4P123CA0475.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1a8::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.19 via Frontend Transport; Fri, 18 Jun 2021 15:24:16 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1ec7a32c-156c-4163-25c4-08d9326d2be8 X-MS-TrafficTypeDiagnostic: VI1PR08MB3376:|DBBPR08MB4394: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:7691;OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: HN54RXrabJQR/L1uwQQ9btnRJPAocoC5WsD62lN4t5UE+mYjTOqx8A8UTa2EHQUN5vyiMyCObxZ6r0c/JpZNYheRtbHgipjh4pnqKn9A6t2w6b3LEkO6m1PE+BRyBg6nrknYzbY3ueQLt2eF3qTZ76MiJdYm7WnGMWPusQKgaJGTABxbMJ2yrBoqoVZZOdgpKXuRKaYKOnixK2IZaYUAs19fNyhXU4e1/m/WfDxbBFAZ866i9a43XgRaz/nHwqAuDepCJ7fydxv3z9BOzOlf5lY/Muvz942Tv4hPNhgRJzWwlzjaLIbkI32H8HvvnHWWva0sPLQiKE1ywRRbUCz6MYMfx5LpC63paf7jGIthM1Cd9lM1LYCEs58mA0TO629Lc0/1L2QpyvJsxEGQG/Tr1WaCyd5WXFo3nEU+R7wXGocXlK/tCfgDMV0EgxM5k9BCsyUcVEoYQOtQMKK8Gk7CaVXNeDDEf4q/qIVcdDp3ddcrNY50bX0ZDiPlbN3kyJSo1ml7qMVh9q0YVogpBysh8CemrFBf819EA4Iqbtfm8OyWPXfE37JKcY4ROZv7aVxr116ohAsSSNn2sB7S/xZhWs+f5nyMmvHwUI0p7uk0i2Pyy3kZ/hgJn1G0Zcqyma6jrEarV+y+GOVDVpypI8/snr7FqU95PXOv1KKBEEPP9q3kJX9iOznZhcnXv6mUp96f X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR0802MB2368.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(39830400003)(396003)(366004)(346002)(4326008)(52536014)(6486002)(2906002)(9686003)(6512007)(66946007)(508600001)(66556008)(86362001)(66476007)(66616009)(8676002)(8936002)(30864003)(16526019)(83380400001)(34490700003)(186003)(26005)(33964004)(52116002)(38100700002)(38350700002)(235185007)(5660300002)(44832011)(6666004)(956004)(6916009)(33656002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Q77vFnDIQ8FMmb9aQBtpPUCaDqP0HcmsBhcTEpxk9/u8ocqsSVBzvzdmSmuXf3Sl28G8Z1pEZyoEINkRDirclN+rTT0UTG22y38HG8xvxOBGNBm/hUtSMcPVoQM9aU9PfELwzDuttM37+/2iGK50hugg7nw0dXFBiyjBe/04VgZpaMMF3xbECm6TjhgSrDE9mB7wQw75LbXYtMz4YbGchwrocC7eK+mBH0Q98oofTnR9bCK3+ZM0Qxh9i8i8Ew7DU7iisQhHiFJSt2NgoxgNNlXZq1x2hLZQW/JVkqA0ZkeO4QaeHMiNB7YvNxw+dDthmfIreVwgqOjPjRpK5tYhNSRQNm50HEC57uQ8enfUuQ34h0LzA1eHoTvk1TVy2DOdfvkk5RN4o0I/8vdBC3Do6w0KXtabuGx6m4LHyRZIOkJ7g8qpXQcKfK+Qp7V5WS8KEqUlmVCGoLa5Pny71tLr2oLzS4TDXmnLBsGpz0Nxxjd8WeUyDdkFmntIQt5aKy6sTVs4aL0QW1Ws/4ToOi6E/MAhQYiaCstkdbDV9Fxzm6Ziy3/1CMa01jt/nnVnnPvd+wdJ81G7dGPx+jmk661mLoqd/LOD2jzQrp/886/SwDdEthJuUy9FozniXsle4ihsQDuvl+01URkgY3iZxxxmsGfp27+nbuCqVErRLh/xrH3kAibOmoEvwW12AyWzA/GU/TVuo0Ostic1cFHRM8/MppveYWxTIQH6Lv90kVPUtt/W80TSR9p44STsmmD6R2PfDg9qC1IejPwBxePe9aTdjRSzGgj3GRjjjhZQXzpku9lETLSRMcFbqLA6Ll1EfXZwjM1st3jv1oDzs+3o0d6gQtMycM5P6SS+We1sxtTCIlBZGFn3HoFmKn1C5HC0PWMu4KyDW9QMNqnifmptCeUzyVVSt+gtpDx1D4X5jmC0DP18aI2JLoaDc4xNvFXpqzKxy3SbT37YqIG/rb3F3dr0NDetmQ8Tx/yo8HgQm0ZoXFQvt/MNCZlC/VWXoM2CgbfjQeQpIRMSiHk/5aD+zfwaL6Fz4aSfU9/1jxrDZd7kdNSGjoT5EcoM+3e+RZ5tsXPq2yk6JegeKwWTLw1HFqnKcj8RLbhRN6GDUR94kyv7Kj8n/pjVovVbCvlD/lazuSMDT9sJghJB3tFRuxB2quolHlgPELSJjqFRhjRMc/qlazqvln+XyRJ9QB49WVznnLz3CKuY80i0nfXE4EygNHDts0ibjQ8U3HGADZwgfvWFNo8qwd4buM78Y39mHla/3DtTb6AI5rsAelHXrAcr3iA3Yb7TcmvtmqrsiQQpOVpLugNZK1FBeJm/vOb4SEBqg4xz X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3376 Original-Authentication-Results: gcc.gnu.org; dkim=none (message not signed) header.d=none;gcc.gnu.org; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT005.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 7eb398c6-e063-437a-15bb-08d9326d22ca X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: i+7Tt9cZp8PvSMTaxlUvF8a+aOHLjtGuP/efvQ2s78rpxMavVMfvBcmtSAoHpRGZlumfkwDa+luI2r4ObWkQaBxRICwy3DqEHLovl8u0ghpQEdDRKjbarMQO8i785F4tjP0d/ZFpMRXtmSMPjDH8vKK8HS5PHqVRC+F7q2MpN0o1wmK8Nz7VYOPHfWu4xe8T97nOo1HC900rNPETLZjp7zHX9znWckuCvzhxwooB8K97jrji7fTiBaWUNhzLzdOsZ0/OVDcNg+G7SXTiCJBqAe/vCSYaPGFTJyEOhkHzfPiOqb52+FUtthPNSjFjRotitcIqiYY4V4z+fi4vvQDkZ+ckupZzxTJ+5kvWp+CiLSRhNhXudJcC74fzQSROcNrkMyXrWTUgnvR1sdB9kLPTfOdSr8E1jV6ViokDULrecHULarZClzgMrpK7hbxx2ZE1xvWsX2pZTh2p/POWG7wcdgPh81Fe4K7JsuCpP9l2YDMut1YKHgAo3pOgADaSu0D2NF8rj3h1tzQdkp+t+0HVFi+xqjmOmJnFsF86iwios2RPB72QSe3zD0YKShGGBuIj0Z8/XrI6O5oH7AGspEjnLzmDdNUnsiOvkQtRJn6Y9uYdXZ4C42Kv22H4Oqejzq3o75DVr9L36c8N+RSzCsY/nLW5o85uaTkLjZYk5Vhz1Yk= 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:(4636009)(39830400003)(346002)(396003)(376002)(46966006)(36840700001)(8936002)(70206006)(70586007)(66616009)(8676002)(4326008)(6512007)(9686003)(5660300002)(235185007)(33656002)(26005)(186003)(16526019)(47076005)(508600001)(44832011)(2906002)(83380400001)(86362001)(81166007)(956004)(6666004)(356005)(336012)(30864003)(6916009)(82310400003)(36860700001)(52536014)(6486002)(33964004); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2021 15:24:31.7515 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1ec7a32c-156c-4163-25c4-08d9326d2be8 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: VE1EUR03FT005.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB4394 X-Spam-Status: No, score=-14.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, KAM_LOTSOFHASH, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Srinath Parvathaneni via Gcc-patches From: Srinath Parvathaneni Reply-To: Srinath Parvathaneni Cc: Richard.Earnshaw@arm.com Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Hi, This is a backport to gcc-10 and the patch applied cleanly on the branch. On passing +cdecp[0-7] extension to the -march string in command line options, multilib linking is failing as mentioned in PR100856. This patch fixes this issue by generating a separate canonical string by removing compiler options which are not required for multilib linking from march string and assign the new string to mlibarch option. This mlibarch string is used for multilib comparison. Ok for gcc-10 branch? Regards, Srinath. gcc/ChangeLog: 2021-06-10 Srinath Parvathaneni PR target/100856 * common/config/arm/arm-common.c (arm_canon_arch_option_1): New function derived from arm_canon_arch. (arm_canon_arch_option): Call it. (arm_canon_arch_multilib_option): New function. * config/arm/arm-cpus.in (IGNORE_FOR_MULTILIB): New fgroup. * config/arm/arm.h (arm_canon_arch_multilib_option): New prototype. (CANON_ARCH_MULTILIB_SPEC_FUNCTION): New macro. (MULTILIB_ARCH_CANONICAL_SPECS): New macro. (DRIVER_SELF_SPECS): Add MULTILIB_ARCH_CANONICAL_SPECS. * config/arm/arm.opt (mlibarch): New option. * config/arm/t-rmprofile (MULTILIB_MATCHES): For armv8*-m, replace use of march on RHS with mlibarch. gcc/testsuite/ChangeLog: 2021-06-10 Srinath Parvathaneni PR target/100856 * gcc.target/arm/acle/pr100856.c: New test. * gcc.target/arm/multilib.exp: Add tests for cde options. (cherry picked from commit f58d03b5df25f9eab06b7eacea8da780fc2e0219) ############### Attachment also inlined for ease of reply ############### diff --git a/gcc/common/config/arm/arm-common.c b/gcc/common/config/arm/arm-common.c index 78a779c935071c534a780821d399cb7d2e170808..a4b3e86ad5251be18f7131cd05fdab40f11d3742 100644 --- a/gcc/common/config/arm/arm-common.c +++ b/gcc/common/config/arm/arm-common.c @@ -590,9 +590,15 @@ public: The options array consists of couplets of information where the first item in each couplet is the string describing which option name was selected (arch, cpu, fpu) and the second is the value - passed for that option. */ -const char * -arm_canon_arch_option (int argc, const char **argv) + passed for that option. + + arch_for_multilib is boolean variable taking value true or false. + arch_for_multilib is false when the canonical representation is for -march + option and it is true when canonical representation is for -mlibarch option. + On passing arch_for_multilib true the canonical string generated will be + without the compiler options which are not required for multilib linking. */ +static const char * +arm_canon_arch_option_1 (int argc, const char **argv, bool arch_for_multilib) { const char *arch = NULL; const char *cpu = NULL; @@ -657,8 +663,8 @@ arm_canon_arch_option (int argc, const char **argv) /* First build up a bitmap describing the target architecture. */ if (arch) { - selected_arch = arm_parse_arch_option_name (all_architectures, - "-march", arch); + selected_arch = arm_parse_arch_option_name (all_architectures, "-march", + arch, !arch_for_multilib); if (selected_arch == NULL) return ""; @@ -666,6 +672,15 @@ arm_canon_arch_option (int argc, const char **argv) arm_initialize_isa (target_isa, selected_arch->common.isa_bits); arm_parse_option_features (target_isa, &selected_arch->common, strchr (arch, '+')); + if (arch_for_multilib) + { + const enum isa_feature removable_bits[] = {ISA_IGNORE_FOR_MULTILIB, + isa_nobit}; + sbitmap isa_bits = sbitmap_alloc (isa_num_bits); + arm_initialize_isa (isa_bits, removable_bits); + bitmap_and_compl (target_isa, target_isa, isa_bits); + } + if (fpu && strcmp (fpu, "auto") != 0) { /* We assume that architectures do not have any FPU bits @@ -682,7 +697,8 @@ arm_canon_arch_option (int argc, const char **argv) else if (cpu) { const cpu_option *selected_cpu - = arm_parse_cpu_option_name (all_cores, "-mcpu", cpu); + = arm_parse_cpu_option_name (all_cores, "-mcpu", cpu, + !arch_for_multilib); if (selected_cpu == NULL) return ""; @@ -1032,3 +1048,22 @@ arm_asm_auto_mfpu (int argc, const char **argv) #define TARGET_EXCEPT_UNWIND_INFO arm_except_unwind_info struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER; + +/* Returns a canonical representation of the -march option from the current + -march string (if given) and other options on the command line that might + affect the architecture. */ +const char * +arm_canon_arch_option (int argc, const char **argv) +{ + return arm_canon_arch_option_1 (argc, argv, false); +} + +/* Returns a canonical representation of the -mlibarch option from the current + -march string (if given) and other options on the command line that might + affect the architecture after removing the compiler extension options which + are not required for multilib linking. */ +const char * +arm_canon_arch_multilib_option (int argc, const char **argv) +{ + return arm_canon_arch_option_1 (argc, argv, true); +} diff --git a/gcc/config/arm/arm-cpus.in b/gcc/config/arm/arm-cpus.in index db0b93f6bb74f6ddf42636caa0d9a3db38692982..5abcad4c35d07576c1e2c83092e0aac215280339 100644 --- a/gcc/config/arm/arm-cpus.in +++ b/gcc/config/arm/arm-cpus.in @@ -324,6 +324,8 @@ define implied vfp_base MVE MVE_FP ALL_FP # need to ignore it for matching purposes. define fgroup ALL_QUIRKS quirk_no_volatile_ce quirk_armv6kz quirk_cm3_ldrd xscale quirk_no_asmcpu +define fgroup IGNORE_FOR_MULTILIB cdecp0 cdecp1 cdecp2 cdecp3 cdecp4 cdecp5 cdecp6 cdecp7 + # Architecture entries # format: # begin arch diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index 30e1d6dc994e18012fd2e5a1bbd7c69134ee100c..2922dfe677c88cb2b3c445ddfe012f2f40016f3e 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -2357,10 +2357,14 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); #endif const char *arm_canon_arch_option (int argc, const char **argv); +const char *arm_canon_arch_multilib_option (int argc, const char **argv); #define CANON_ARCH_SPEC_FUNCTION \ { "canon_arch", arm_canon_arch_option }, +#define CANON_ARCH_MULTILIB_SPEC_FUNCTION \ + { "canon_arch_multilib", arm_canon_arch_multilib_option }, + const char *arm_be8_option (int argc, const char **argv); #define BE8_SPEC_FUNCTION \ { "be8_linkopt", arm_be8_option }, @@ -2369,6 +2373,7 @@ const char *arm_be8_option (int argc, const char **argv); MCPU_MTUNE_NATIVE_FUNCTIONS \ ASM_CPU_SPEC_FUNCTIONS \ CANON_ARCH_SPEC_FUNCTION \ + CANON_ARCH_MULTILIB_SPEC_FUNCTION \ TARGET_MODE_SPEC_FUNCTIONS \ BE8_SPEC_FUNCTION @@ -2389,12 +2394,22 @@ const char *arm_be8_option (int argc, const char **argv); " %{mfloat-abi=*: abi %*}" \ " %common.isa_bits); arm_parse_option_features (target_isa, &selected_arch->common, strchr (arch, '+')); + if (arch_for_multilib) + { + const enum isa_feature removable_bits[] = {ISA_IGNORE_FOR_MULTILIB, + isa_nobit}; + sbitmap isa_bits = sbitmap_alloc (isa_num_bits); + arm_initialize_isa (isa_bits, removable_bits); + bitmap_and_compl (target_isa, target_isa, isa_bits); + } + if (fpu && strcmp (fpu, "auto") != 0) { /* We assume that architectures do not have any FPU bits @@ -682,7 +697,8 @@ arm_canon_arch_option (int argc, const char **argv) else if (cpu) { const cpu_option *selected_cpu - = arm_parse_cpu_option_name (all_cores, "-mcpu", cpu); + = arm_parse_cpu_option_name (all_cores, "-mcpu", cpu, + !arch_for_multilib); if (selected_cpu == NULL) return ""; @@ -1032,3 +1048,22 @@ arm_asm_auto_mfpu (int argc, const char **argv) #define TARGET_EXCEPT_UNWIND_INFO arm_except_unwind_info struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER; + +/* Returns a canonical representation of the -march option from the current + -march string (if given) and other options on the command line that might + affect the architecture. */ +const char * +arm_canon_arch_option (int argc, const char **argv) +{ + return arm_canon_arch_option_1 (argc, argv, false); +} + +/* Returns a canonical representation of the -mlibarch option from the current + -march string (if given) and other options on the command line that might + affect the architecture after removing the compiler extension options which + are not required for multilib linking. */ +const char * +arm_canon_arch_multilib_option (int argc, const char **argv) +{ + return arm_canon_arch_option_1 (argc, argv, true); +} diff --git a/gcc/config/arm/arm-cpus.in b/gcc/config/arm/arm-cpus.in index db0b93f6bb74f6ddf42636caa0d9a3db38692982..5abcad4c35d07576c1e2c83092e0aac215280339 100644 --- a/gcc/config/arm/arm-cpus.in +++ b/gcc/config/arm/arm-cpus.in @@ -324,6 +324,8 @@ define implied vfp_base MVE MVE_FP ALL_FP # need to ignore it for matching purposes. define fgroup ALL_QUIRKS quirk_no_volatile_ce quirk_armv6kz quirk_cm3_ldrd xscale quirk_no_asmcpu +define fgroup IGNORE_FOR_MULTILIB cdecp0 cdecp1 cdecp2 cdecp3 cdecp4 cdecp5 cdecp6 cdecp7 + # Architecture entries # format: # begin arch diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index 30e1d6dc994e18012fd2e5a1bbd7c69134ee100c..2922dfe677c88cb2b3c445ddfe012f2f40016f3e 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -2357,10 +2357,14 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); #endif const char *arm_canon_arch_option (int argc, const char **argv); +const char *arm_canon_arch_multilib_option (int argc, const char **argv); #define CANON_ARCH_SPEC_FUNCTION \ { "canon_arch", arm_canon_arch_option }, +#define CANON_ARCH_MULTILIB_SPEC_FUNCTION \ + { "canon_arch_multilib", arm_canon_arch_multilib_option }, + const char *arm_be8_option (int argc, const char **argv); #define BE8_SPEC_FUNCTION \ { "be8_linkopt", arm_be8_option }, @@ -2369,6 +2373,7 @@ const char *arm_be8_option (int argc, const char **argv); MCPU_MTUNE_NATIVE_FUNCTIONS \ ASM_CPU_SPEC_FUNCTIONS \ CANON_ARCH_SPEC_FUNCTION \ + CANON_ARCH_MULTILIB_SPEC_FUNCTION \ TARGET_MODE_SPEC_FUNCTIONS \ BE8_SPEC_FUNCTION @@ -2389,12 +2394,22 @@ const char *arm_be8_option (int argc, const char **argv); " %{mfloat-abi=*: abi %*}" \ " %