From patchwork Mon Jan 15 11:26:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Carlotti X-Patchwork-Id: 56609 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5E14D3858025 for ; Mon, 15 Jan 2024 11:42:42 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2043.outbound.protection.outlook.com [40.107.8.43]) by sourceware.org (Postfix) with ESMTPS id 44F0C3857831 for ; Mon, 15 Jan 2024 11:42:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 44F0C3857831 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 44F0C3857831 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.8.43 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1705318932; cv=pass; b=rifWlo3Q5Ext8x/McrcrbWOTpeZMzUh/SnfNQy29HuSzcLlVDMlL2BSkdA4+X9myBzdE8BydW1VqLVTaT1hgDva7A0Sj0o8WMt33UxuHlhOMcqgxHAH+ze/EWB8tOeK0yHnK0AxuAVz7hLC7q8/HZYA6jXpEXlQwiG/9kIXtqT8= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1705318932; c=relaxed/simple; bh=C1GQ6WNHLXe58VzkjPFepZsrxzAdROhY66o65iNt6B8=; h=DKIM-Signature:DKIM-Signature:Date:From:To:Subject:Message-ID: MIME-Version; b=bCV8JO/WWpMX6SCEU+t5PGFryiHKvwL+0WvSQzEP2wTr6xKyxmDCmQa4kD8n1aEJy8GC7T7DnKB9O+LDmlDlJfSoVOUwt/+d9HA+uCBfs4Yosnq66M4ZYGUVwXjiFU8nppoBvt1mNG4zpfaQCtPi2uX0xwpiX7JS5QBgbUQekw0= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=KmNMOJqgVkYN6aYoQomUTWPyZ2IPS3knn4BFteGWQ9qA2qkqMvnR+bHB+vs8v2PAJ7Un24ndjgGvZaCZO3nynPecLjFVB1Av9Va8UsOmyqZI+rPutkxhrxHye7I9rwO/rCfVdCFBCRUYt0TTwrjC5WYPVdDDMChl5EXKc8TErHPX/pUBa7t8l4sJIlonY9x3plMkDDtliB/h+SklKIOP42b90Xtq+lgl1X6ajD/JvX9pgHXtUh51TONy823hyl8C6Dd+m6cBzp+wHiZCWzjkiS0ccZQt5F8TfBRgOB6ayicMzYotyeQIMXVDFqP0J3PkFLan5fTP8hRmVXxjpQ15Dw== 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=WWLGey8Lsi6Iz2AoLp3XG48lVxb9TGIwkjMMK8ewShI=; b=atIOv2t3GTODrQwGE4h7gflUctddS22ykVf0zk6Mzrr2+5pVEAldgTdphnv8SaXQSd2r0OLcUtTRxfO2qCf00c0I+yzhD5kfYE9bKu4wmVVLlZt9Uyw7MXEvunJIs5yAI118DZiTNDpK/Kh1eqS5zpPXvwjZ3GCHvWUD3/Aq61AO9Wi5vkVSuvIDdDURbcB4H5ZXNwogtcRTsMa4IJCBoVla2vu7BiCw+MZk9AkUC4NqO2gjRuWJhQQ0zI+Gw3wFgM7jNpuWcpSfHmoYW8ALuLju3EGQo/p5OQtY+8FuAj4zmiXVbVvVTYOKAEi7GfQjmxoW3BW5MYNaUDwmV4HKSA== 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=WWLGey8Lsi6Iz2AoLp3XG48lVxb9TGIwkjMMK8ewShI=; b=o4D+Tj2y+mWR9OPoih+V7JPEOjSgN9DBBcAejEPR1W3SMkHt9KpmcXjPEVB5+F6rMAvmU99NhM3Ukb+3mJ29Sq8X1kCtlRg2jD666m1ftbc6w/Lwzy7801p6YW81F+BtgTwWdaeuybniNdC3owxy/me3IiAR98q3OXQM9PwcZK8= Received: from AS4P189CA0064.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:659::24) by AS8PR08MB9575.eurprd08.prod.outlook.com (2603:10a6:20b:619::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.18; Mon, 15 Jan 2024 11:42:08 +0000 Received: from AM3PEPF00009B9D.eurprd04.prod.outlook.com (2603:10a6:20b:659:cafe::b0) by AS4P189CA0064.outlook.office365.com (2603:10a6:20b:659::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.26 via Frontend Transport; Mon, 15 Jan 2024 11:42:08 +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 AM3PEPF00009B9D.mail.protection.outlook.com (10.167.16.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7202.16 via Frontend Transport; Mon, 15 Jan 2024 11:42:08 +0000 Received: ("Tessian outbound c4f080b252bb:v228"); Mon, 15 Jan 2024 11:42:07 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 7d59eb2c26957071 X-CR-MTA-TID: 64aa7808 Received: from e3a51e91fb06.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id F7BC8042-05D3-4B8F-89F4-310E9A7D207D.1; Mon, 15 Jan 2024 11:26:10 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id e3a51e91fb06.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 15 Jan 2024 11:26:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oHS3LhFxqjW5pqYZ/UNegU9mjNPyxol7yQP0wB3kWUHTBN19Q9FKh2sbnpiZmAb6KV0pbUd3gEKG055bGYeFwz+Z+kOHMhX/gnuREbrcXpAjO5abSm/vjGnvz+6C0Dj+8UVsg3a8pt+OjstjprgL+k6aE+tErgLEY2BDFk9CQgMdqq7GFHjcrecMNxUo7ZkwwPYKI2g4IOi0LdxfqiTHWcqLPM5797QP5Zq/ZbV94vRma2h1Y+SVEAHI6ByUI6KGspYwtyWtfFoyG8OByTV8J0pi/3qyhRpLDIetEgG20QxMfA0LN/JrfEc2dEZhUPj4cwaj/h+8s+C7kzUA1/p/lg== 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=WWLGey8Lsi6Iz2AoLp3XG48lVxb9TGIwkjMMK8ewShI=; b=gKWblCDAx8TlGHknkqUAeet7NC/PmvskcDgdz/06v3IzCnPMScY+8xbsIZoDpGC3Z5oygY8ad23prxLp1XMgQ2fDr8DILyPQlrRHhgCLu9qXennsQ7DeL64tBtFFThNdKGrs42HvKXM1BzxpnXNaBxOURlwjJjfUsh9h3oLf7YZdq2tn4Su48cHxHYlGXAU3xMRTGlDQMdi2AhFamue6ppT2E6F8zHE6BZktFjTGZRxz6dGHfv3AmUwSOgr+GGlbc1kxujJB3Qug7DPcuT99kOTWKUD1zzLY9FV0yYWSEQubw78H1SX6wh8nH4BlSWVXM7UjyI3eFeqpnd9ybQW8Og== 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=WWLGey8Lsi6Iz2AoLp3XG48lVxb9TGIwkjMMK8ewShI=; b=o4D+Tj2y+mWR9OPoih+V7JPEOjSgN9DBBcAejEPR1W3SMkHt9KpmcXjPEVB5+F6rMAvmU99NhM3Ukb+3mJ29Sq8X1kCtlRg2jD666m1ftbc6w/Lwzy7801p6YW81F+BtgTwWdaeuybniNdC3owxy/me3IiAR98q3OXQM9PwcZK8= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from AS8PR08MB6678.eurprd08.prod.outlook.com (2603:10a6:20b:398::8) by DU0PR08MB8929.eurprd08.prod.outlook.com (2603:10a6:10:464::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.19; Mon, 15 Jan 2024 11:26:07 +0000 Received: from AS8PR08MB6678.eurprd08.prod.outlook.com ([fe80::a997:a5ad:3e6:44b6]) by AS8PR08MB6678.eurprd08.prod.outlook.com ([fe80::a997:a5ad:3e6:44b6%4]) with mapi id 15.20.7181.022; Mon, 15 Jan 2024 11:26:07 +0000 Date: Mon, 15 Jan 2024 11:26:05 +0000 From: Andrew Carlotti To: gcc-patches@gcc.gnu.org Cc: Richard Biener Subject: [PATCH 0/5] Fix fmv mangling for AArch64 Message-ID: Content-Disposition: inline X-ClientProxiedBy: LO4P265CA0280.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:37a::17) To AS8PR08MB6678.eurprd08.prod.outlook.com (2603:10a6:20b:398::8) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: AS8PR08MB6678:EE_|DU0PR08MB8929:EE_|AM3PEPF00009B9D:EE_|AS8PR08MB9575:EE_ X-MS-Office365-Filtering-Correlation-Id: 988ce192-da3e-4875-cb86-08dc15bf011f 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: xD7KUB3ZqTonOdsFyOro4PXG/Of5o/JhkqGLAp+AwkIPq/s4S36FE5Ijsn94qtkA9CX9bwg0R9AYUU4fWfqRFX64XdDP9uIZK6b+uW/qaJl0ogWh3kAcSzsA3UJVTtwLfOXNjDNYMXGoutyx5aOGJAkwXzmBliiwqSP3DnjM/SAKGU5VHksNJiPRifXJtEwHhb3aL/gN0zDwqZuES5ZFnMUJmXsQ/2ZjCb5gQDoIekXwEwx9nFBSgf0gGsv/DnFc4oHoupEKpDqzJu4bPBisIGPYnDUuGKvIdpt0GGdjM2Qn4VtrrCev2Gmse4PQ+LYTbAH1n5s9w/q9zSrQ6+YnpXiAXa+hCA3LeiHeyo9R+7BDDKNuK5IfWQ81OnfD3FyDML3alN+lSsMg3APC47EKBN4UROHLnIyoDnnKEdRBWM5gdRypT+DRauA4f/mE6gREOpD6ymNpIHSeyXkYa3H/+SJqR//VzyXipT+2VpJOH67UdqcoQZN/M1jqxr1aUjU/k9PcJhJSllCuhbb7ShcFl15lapD7MuHAX5TqJl4nNc6okEi2QOt866qMt/2SGkmY X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR08MB6678.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(39860400002)(346002)(366004)(376002)(136003)(396003)(230922051799003)(64100799003)(186009)(1800799012)(451199024)(66946007)(6916009)(66476007)(66556008)(44832011)(6506007)(6512007)(316002)(6486002)(478600001)(41300700001)(8676002)(8936002)(4326008)(2906002)(5660300002)(83380400001)(31696002)(26005)(31686004)(38100700002)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB8929 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: AM3PEPF00009B9D.eurprd04.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 1bcdfae2-c52c-4133-70c5-08dc15bcc493 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lHB1Uiedfen6INFFdFBJcN7AFU/jCPZcRTDZkDSEEBTb8hPel4rL3caua+a9/u5FMcqzjhHr5xsde5D9OITqXUOUANvp3LFTW5hAmoJmXJHVUVzjk9HJxO36R+gCUEUQm2URGqh3qWyIQRD1TSedaUxkKcFYGlzfwD8P7ywBMOrGbqf0ZAXOAUuvcrS4/4rclovwSTyAlS3KqpvVN18Zn9gjEIJDKLW3mm2XQN+jK5dUCapHSd9Ysuay977DRFbfhJPNltmaNON5zTWIjzdqruI2PZIxF0Cysgs5ZybhLZpC7tFAO8JcHt78LFu6gXKvJBgqE2YMy6Nd3Fjq/XgF1Vpj7VmlNzRZgwsKixllUB4oppGS0GyOWi4CpcXghX7EVveEvGnJ5oBfAsNe2V6lU4ZiKLoeu9qCVSqg0Lb82NbRv8bmyADpLLRqF52abuWh1WcJTfVjOClu9AYdIcpRMTzKaeLDgz6YgMPrbeXzoIcvbFzQ2RUFegXV75JXcDfQtVrcdU9U4Ted6/4om37q1SJghZ11Wt7RaVcooo4WXsu8bAFaOzlZ0K34D55d0vsTBWDppkNP+Yu9oCVOcSgTtpeWg+P8907kyoEYvxPxbqs3YkLqOhGclFQUghbeolZ+/SooR4959txNoTHOgkz3DuqywL0a/CULhiUqFdomBh/YRribWppihHvhFkq9YxUzlr5N+WMiZ9CNC+C4bd1he6EeUPFEwwUUwgLSAitMbu0FoX3Qg550Zdf2hxELifx7 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)(376002)(396003)(39860400002)(136003)(230922051799003)(186009)(64100799003)(82310400011)(451199024)(1800799012)(46966006)(40470700004)(36840700001)(40480700001)(31686004)(40460700003)(83380400001)(70206006)(70586007)(41300700001)(86362001)(356005)(81166007)(31696002)(47076005)(6486002)(82740400003)(107886003)(26005)(336012)(4326008)(6512007)(316002)(36860700001)(8936002)(2906002)(6506007)(6916009)(478600001)(8676002)(44832011)(5660300002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jan 2024 11:42:08.0940 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 988ce192-da3e-4875-cb86-08dc15bf011f 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: AM3PEPF00009B9D.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB9575 X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, KAM_DMARC_NONE, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE, 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 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+patchwork=sourceware.org@gcc.gnu.org This patch series should have no functional change besides the mangling of some symbol names on AArch64. Patch 1/5 adds lots of tests to verify that existing mangling behaviour on x86 and PowerPC is unchanged. Patch 2/5 extends DECL_FUNCTION_VERSIONED to a 2-bit enum. Patches 3/5 and 4/5 are trivial refactorings. Patch 5/5 is the only patch with any functional change, and that should be minimal. I've bootstrapped and tested the entire series on both AArch64 and x86. I've also run the new x86 and PowerPC tests on a cross-compiler (with a temporary hack to disable ifunc availability checks) to verify that function multiversioning still works on those platforms, with the symbol mangling unchanged. I'm aware now that we just started of Stage 4, and this isn't actually a regression, but is this still ok for master? Some other things I previously tried that I couldn't make work: - I had hoped to create an explicit target hook for the ifunc symbol name mangling as well, but it turned out to be rather tricky to replicate the existing double mangling weirdness for x86 (I didn't work out how to convince the frontend to apply C++ mangling to the new symbol on-demand without breaking other things). - It's also awkward to try to access the base assembler name after applying function version mangling - this is why I resorted to just reversing the default version mangling in the AArch64 backend. I tried delaying function version mangling until after the resolver was generated, but that led to issues with duplicate comdat group names from make_decl_one_only. There may be less hacky solutions or workarounds for these issues, but they would involve a more substantial refactoring and will have to wait until GCC 15 (or later).