From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2075.outbound.protection.outlook.com [40.107.20.75]) by sourceware.org (Postfix) with ESMTPS id 54D483851C29 for ; Tue, 23 Mar 2021 11:52:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 54D483851C29 Received: from AM5PR0502CA0021.eurprd05.prod.outlook.com (2603:10a6:203:91::31) by AM6PR08MB3270.eurprd08.prod.outlook.com (2603:10a6:209:50::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3955.18; Tue, 23 Mar 2021 11:52:36 +0000 Received: from VE1EUR03FT059.eop-EUR03.prod.protection.outlook.com (2603:10a6:203:91:cafe::f5) by AM5PR0502CA0021.outlook.office365.com (2603:10a6:203:91::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3955.18 via Frontend Transport; Tue, 23 Mar 2021 11:52:36 +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 VE1EUR03FT059.mail.protection.outlook.com (10.152.19.60) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3955.18 via Frontend Transport; Tue, 23 Mar 2021 11:52:36 +0000 Received: ("Tessian outbound f15357ab733e:v89"); Tue, 23 Mar 2021 11:52:35 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: ffecb71624433826 X-CR-MTA-TID: 64aa7808 Received: from 193e9339e504.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id ABFD5635-05DA-4D6B-9D86-EC787958593A.1; Tue, 23 Mar 2021 11:52:27 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 193e9339e504.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 23 Mar 2021 11:52:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eWojH4wqRWRT4UdM2baTWlfNbsozYPZbudtJnUUc2YUy17I4CPQBh6GheFb30HH/mk24kcVo5mkiCZfEzlbCIrwqlpDcRndjA0VqpHsEYshBAmrPD77K0sPpk95insfDHrkx/tgvhZqFZiCCwpVyEr7wXKAuOjI7oWoOqYJ6ogjt2LYA/ZyHfH+yB5x2qxVcvFoJid6YzQfDbYfXbZZ7S5ip30YGUp05UmENmhtI9siAAo7nldPsWSrGzpbHiOyeyeJ4JnmpdJuFce+gVkW4GuUc1T81jYQWf4QPXPtoheU3iWoFjn9b1YJc2Ep1MW39ukjI6VLU6isObipXnBYzPg== 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=83o1Tx3I1iJvyqKBnwEXsGLsPe+Hyqr17aEIiutTBV8=; b=C8HXbmr3fWP1I1SwR1OZbYwkdlefbVeE/Q+KC8GKomczEPa/kPWN2EnrZ2wcgUq86NHtiq32tVSVvEfQ3S5trdTSCD2VWr/1sKJsvfIox3wfRvNlRtKTGyxnJR4wRcnbTRdHpKaoE2VE+PkCfgdJEW5/UHPHjkEjbVQaXZF1bxiwhu2ZMmUPlVvt7EEV/6kAE4FR47LmWZb0NEgWjY/XLlCV/KF5dP0x1PFXz1UnwUqQcCQoTPHkuEuury+st93/l9E4LAPq3LliYbm15HFqMJt5oX0P3K2I41c6L1BqYiakImowXAJlG5Rb86b5evfRK7xkKUFCidTPnTQCtUPvYQ== 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 VI1PR08MB4029.eurprd08.prod.outlook.com (2603:10a6:803:ec::14) by VE1PR08MB5021.eurprd08.prod.outlook.com (2603:10a6:803:108::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3955.18; Tue, 23 Mar 2021 11:52:22 +0000 Received: from VI1PR08MB4029.eurprd08.prod.outlook.com ([fe80::91e5:a54c:eda6:49b2]) by VI1PR08MB4029.eurprd08.prod.outlook.com ([fe80::91e5:a54c:eda6:49b2%4]) with mapi id 15.20.3955.027; Tue, 23 Mar 2021 11:52:22 +0000 Date: Tue, 23 Mar 2021 11:52:20 +0000 From: Alex Coplan To: gcc-patches@gcc.gnu.org Cc: Richard Sandiford Subject: Re: [PATCH v2] aarch64: Fix SVE ACLE builtins with LTO [PR99216] Message-ID: <20210323115220.rzasuqyhwlx5yf43@arm.com> References: <20210309154058.5u6cvoo52yrijpue@arm.com> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210309154058.5u6cvoo52yrijpue@arm.com> User-Agent: NeoMutt/20171215 X-Originating-IP: [217.140.106.50] X-ClientProxiedBy: LO4P123CA0179.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:18a::22) To VI1PR08MB4029.eurprd08.prod.outlook.com (2603:10a6:803:ec::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from arm.com (217.140.106.50) by LO4P123CA0179.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:18a::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3955.18 via Frontend Transport; Tue, 23 Mar 2021 11:52:22 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 6919fa53-dace-4e7a-7e31-08d8edf226f4 X-MS-TrafficTypeDiagnostic: VE1PR08MB5021:|AM6PR08MB3270: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:8882;OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: cf38i/v0d8Rv4ebeas2ytzP5UQNwb+CuIrSwRIXHsOzLXOD9dzC0hfcYF2WVRj1RsgbdF+0htZomAFe0p4Lj77aOS4nsnOeJUw8+d3/ITvUnHvrm+M8rvmHEfhHxEr2Kb3KX7kFVMxyLx5wbE8koTTet/FIuQ8glSzXnQ7voOfgp2EX8bqDIGGJy+1jg34sF0P05g0isUYU+VWyJNHJBZ/dEH6uBVrlspd0mVDKz7w5mYYGQn081GNMmKyOTFmNSZrhTdibMhsbYmELOYZl548swhJpYVnd7bOMSLK4uBxLmQWqOmwNhSCUqJuYVmqe5Pz3fPJ/1tOhO8pd5z0pNrMXaeQ2pBmxZIWGUj4YBdaMy7nOnM02t34J1xKpwk5DOe7AZID3WsKIMarDA7qriZwMLXnmyb1M4H1CSJw1tmizZRsC2Ntl2QlM4vA9XHEOIJUQUAxTpgP7hh76p9pCLsKpBKQtV01G6raYmW1OTrNnR2MY1Vp1pgyH76CVOYkeT0tbtkZeipo4MBzTS2hNuliQDWk2Hm0c0ADN89FP6NNzeJCvRUGt1DjkwbGjev6QUr76otcbyrbjrzNa1/R34uU5B6zY06F79AkA4k5F+AZ/VHIpylSLN9+/QEQ1z/HSZpbCFKruiz1Vo83QsqHKLA+6F5cINYyhaXW7tm1V/wJ3QnoLX5cqISq8Dg5/E4Js1BRnlv+Gu4Yww+h6sl4sGAWLLg6ZHnWZilF5Nfn/Twis= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR08MB4029.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(39860400002)(396003)(136003)(376002)(346002)(44832011)(66946007)(66476007)(55016002)(186003)(16526019)(83380400001)(316002)(66556008)(5660300002)(8676002)(53546011)(36756003)(52116002)(7696005)(956004)(26005)(2616005)(966005)(6916009)(86362001)(4326008)(8886007)(8936002)(1076003)(478600001)(2906002)(38100700001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?B?emVCdUhqNlhUUkhKRDQrMkFKaFB6Q2VDbXc3YmJLUnIvTG1nejF6NGM0cHBY?= =?utf-8?B?clBBWWpnUHFBUkxYSDlUdEpvenNBcWU0RTN1cHpWWHVManVNVUx2aUh5Mkk4?= =?utf-8?B?cGZEbWRLWHpCQ3gzajNienRENm5vTnB5QisyMk5xYTUrOHllUDYrRlJySFZS?= =?utf-8?B?bFFnQU9wek5CZk5OYy9ja1l3VEQvMG9WSUVKc3NHcDFSZDh3SE90YnJvNFU4?= =?utf-8?B?cklibko1b0U5QWgzZ3FDTlc0OVljVUdDQlRpM3R2V0xVR2lXNmlZKy9xakh0?= =?utf-8?B?cG85aHJqWGUzL1N2cDVTdmZQckFmYlNUcStkUzB6ejhkc3dOR0FrSHp1aHls?= =?utf-8?B?NVhiSE8wWGJXZ0V4QnRKYmllRmg3QzRVN2JSaER3TEp3ZHI2SnhjbzdpMDdz?= =?utf-8?B?MmEwN0hQU045RFZOZFlLK2hCTlpDRXNHZkxoNGI1dFozZ2ZndFNzQUVENUNY?= =?utf-8?B?QURtOGhPZjlQUGZtdkRZbjBDb2pqK1B3d2srcjJvNTl0RHRnbCs0U0dEcXZ6?= =?utf-8?B?dnE2QTRXYnUvWmJ3ayt2SmZYVXF3RExXbzZncDVMRmVUT3ZFSUF5dnRoQ3k5?= =?utf-8?B?SDJSK3FJcC8vbnFJWCs5WXJveFluaXNmMGZJV3dEbU0zMnR5QTBra09HY3FJ?= =?utf-8?B?Ui9qNW1EaUl6Tk5LM2Fpc0lIemgwMjZOdUZCak9HR2YrTEZHdFRYZEhEWmly?= =?utf-8?B?cFVaUzZ2RmI0RG0yZW9CdWZ5OUVndGhrMjNFaXlGZUZUc2RiRFBHc3dSYzNl?= =?utf-8?B?UWZ1c0REOHMzUVZUVjVNRng3UkMvMlZLUzNMK0xpbUxwSTFnUnlsOVB1L2hh?= =?utf-8?B?WEFKcERUekZMUFVuUnBReDdPaXNENkZOeDdQcjBlWjVCTEdRcE51RWR2d3Jk?= =?utf-8?B?bmZib3RkM0cyWEdZSEN0QUtCL1RmM3RPK3JRVW40QVIvL0FMZ0ppZGFPMWtR?= =?utf-8?B?K1pkaUoxOVpReGl1WWdTT2hrNVZDSW4reGpyakxIUnVYUEdCaUpqK3pJdjBn?= =?utf-8?B?WVgvaitHcEczVHREbS9UTEg2c3NhWS94bG56ZEVGRjdyamtOeXBzNVJqajFa?= =?utf-8?B?VWhERjBKTVZ2ZlNRYzdscG9jMFQrTnRtRUpJTm5KSzQ2aXRhYTZmSk94Nmsy?= =?utf-8?B?N3VaS2lSc3AyNS9aakRidlp3bnh3eVExb2MwMVJ3OFE3NlFnbHRCV0Jzdnkr?= =?utf-8?B?d013bXBjbm1rc3NHUmZRRGJoVS8vN2d5bFZ1NWFseElTNm85T2p6Nk1JTFRx?= =?utf-8?B?QytWTmQyeld0cWJyc1VwZVFqeFpMcVFUK1lLeUFLV0Y1bU5aYitLK0FhcWFi?= =?utf-8?B?dkg0alhTc1B1Znhic2hDL00rZ204YnNKd0xrWnV6TnE2ZTJyQ2NZUi9iMzVP?= =?utf-8?B?K0Q2ZHlqamFXbDFXS0ttd0NWaU9uTGlMVURIU1YrSXA1Wk9yckVoUEZJNjN2?= =?utf-8?B?V1JXWk1MN0xOSW82NjhndzBUNlplZGEvczlvWUYvSmNjQWZVam1Jb3lZOGhI?= =?utf-8?B?d3VwUVlibDBnNFc4OFJmR0piVjlYclVTN0pzdjlhQzFaNEt6cklOcGZDQU14?= =?utf-8?B?RmtZaGRQeXpZZHFIUXRoeUQyNFUzWkdsZ0NxZzlTYXJpUkNuSmVPVkFRL2tU?= =?utf-8?B?ODBwMDErS2k3bTJBNk8zTjZMTEdoS0NtNHN1VEdnQXJ4d3pXT1lObXBlUTZE?= =?utf-8?B?SDBzTzhkQXlZUDFmV0lpRnV2bndOa1FhcVQ0eXdNOWVaU2g3QjZjWEhkNWtS?= =?utf-8?Q?sT5uH86GDrTlkNe+HbrM5UU5Sqrtb84V5sg4Wp+?= X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5021 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: VE1EUR03FT059.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: f843c924-9a5b-4fc8-f8cd-08d8edf21e89 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: H3GQgJECgdlMkjOvmk6AIu7bsI25J64o0OhC3jqv30gu7Ags26IrXf9JPaB1vsC2LK1wTHQFBo7IJWMWSZI5RdVSZ6+m0OljRDyQsMO19Bel7n0BjpXC5myDVtsH1OnAyaG09s4gPbZSHIeQm14R/emvc5+0Os81F3+DWo3VNvkfHZ07H6eOdB4l90ed2P0GeFrcbHdDnygKdMIWd7scKhDX0xT8pRq/Qd7VvBopS6A3877iYXxCBKmZaeWPvAZSvUVuUoI8iAPoW+NA6oPLTHziVe2xIJ7FaFZaFfIbQ38iJEWtYtV5oo+8fKputHM6stmWuvcBXercNZ/Fxdqrm+qn2GiFB/6H/tTgc6Ux2WUJ4k0u01WlfZeueMcVJz4CZwtjibKKLVuxNSWDVqzc+RU9PmeEac9qSxWlp2BjS9qBE8o2HHQTKfE+TA7Zhcg6yzH1GZrDglX6MpuN3B4NXN9JsCF/+xBhqUdsRSTCb/BybsoPea3Y/sVveD6Bto8KEtqnFWIduEnI2BCitnFvLj+NrKhKyLUt+WMJwiINrftEcPEtN7XSYYhmSMjZr0e56IlTinK+EWaL3Y0YvqR+J5bi+ip53C9MADGEcqC66cA8o9PhfWOXt2s1YUhtDSQVB+9tbZzaODSTN8TFM8Je+U7tzJ7Sr95Sj4tF33Pddcto0ryu8yXYw8m1/FsZ4q8tRv15afWlPCMclRWQSbdFU2b29dByQXlqqjlxNkpu18I= 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)(39860400002)(376002)(396003)(346002)(136003)(46966006)(36840700001)(36860700001)(2906002)(7696005)(4326008)(53546011)(55016002)(316002)(5660300002)(1076003)(478600001)(966005)(356005)(81166007)(6916009)(956004)(8676002)(70206006)(82740400003)(16526019)(336012)(36756003)(44832011)(82310400003)(83380400001)(26005)(8936002)(8886007)(70586007)(47076005)(86362001)(186003)(2616005); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Mar 2021 11:52:36.2621 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6919fa53-dace-4e7a-7e31-08d8edf226f4 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: VE1EUR03FT059.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3270 X-Spam-Status: No, score=-14.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, KAM_SHORT, 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-List-Received-Date: Tue, 23 Mar 2021 11:52:41 -0000 On 09/03/2021 15:41, Alex Coplan via Gcc-patches wrote: > Hi all, > > Here is a v2 patch which provides a more obviously fake answer to > TARGET_BUILTIN_DECL: this can hopefully go in for GCC 11. For GCC 12, it > seems that we should consider removing the target hook. > > Original patch: > https://gcc.gnu.org/pipermail/gcc-patches/2021-March/566405.html Ping. OK for trunk? > > --- > > As discussed in the PR, we currently have two different numbering > schemes for SVE builtins: one for C, and one for C++. This is > problematic for LTO, where we end up getting confused about which > intrinsic we're talking about. This patch inserts placeholders into the > registered_functions vector to ensure that there is a consistent > numbering scheme for both C and C++. > > This patch uses integer_zero_node as a placeholder node instead of > building a function decl. This is safe because the node is only returned > by the TARGET_BUILTIN_DECL hook, which (on AArch64) is only used for > validation when builtin decls are streamed into lto1. > > Bootstrapped and regtested on aarch64-linux-gnu, OK for trunk? > > Thanks, > Alex > > gcc/ChangeLog: > > PR target/99216 > * config/aarch64/aarch64-sve-builtins.cc > (function_builder::add_function): Add placeholder_p argument, use > placeholder decls if this is set. > (function_builder::add_unique_function): Instead of conditionally adding > direct overloads, unconditionally add either a direct overload or a > placeholder. > (function_builder::add_overloaded_function): Set placeholder_p if we're > using C++ overloads. Use the obstack for string storage instead > of relying on the tree nodes. > (function_builder::add_overloaded_functions): Don't return early for > m_direct_overloads: we need to add placeholders. > * config/aarch64/aarch64-sve-builtins.h > (function_builder::add_function): Add placeholder_p argument. > > gcc/testsuite/ChangeLog: > > PR target/99216 > * g++.target/aarch64/sve/pr99216.C: New test. > diff --git a/gcc/config/aarch64/aarch64-sve-builtins.cc b/gcc/config/aarch64/aarch64-sve-builtins.cc > index 25612d2ea52..f44f81f1375 100644 > --- a/gcc/config/aarch64/aarch64-sve-builtins.cc > +++ b/gcc/config/aarch64/aarch64-sve-builtins.cc > @@ -999,12 +999,29 @@ registered_function & > function_builder::add_function (const function_instance &instance, > const char *name, tree fntype, tree attrs, > uint64_t required_extensions, > - bool overloaded_p) > + bool overloaded_p, > + bool placeholder_p) > { > unsigned int code = vec_safe_length (registered_functions); > code = (code << AARCH64_BUILTIN_SHIFT) | AARCH64_BUILTIN_SVE; > - tree decl = simulate_builtin_function_decl (input_location, name, fntype, > - code, NULL, attrs); > + > + /* We need to be able to generate placeholders to enusre that we have a > + consistent numbering scheme for function codes between the C and C++ > + frontends, so that everything ties up in LTO. > + > + Currently, tree-streamer-in.c:unpack_ts_function_decl_value_fields > + validates that tree nodes returned by TARGET_BUILTIN_DECL are non-NULL and > + some node other than error_mark_node. This is a holdover from when builtin > + decls were streamed by code rather than by value. > + > + Ultimately, we should be able to remove this validation of BUILT_IN_MD > + nodes and remove the target hook. For now, however, we need to appease the > + validation and return a non-NULL, non-error_mark_node node, so we > + arbitrarily choose integer_zero_node. */ > + tree decl = placeholder_p > + ? integer_zero_node > + : simulate_builtin_function_decl (input_location, name, fntype, > + code, NULL, attrs); > > registered_function &rfn = *ggc_alloc (); > rfn.instance = instance; > @@ -1036,7 +1053,7 @@ function_builder::add_unique_function (const function_instance &instance, > argument_types.address ()); > tree attrs = get_attributes (instance); > registered_function &rfn = add_function (instance, name, fntype, attrs, > - required_extensions, false); > + required_extensions, false, false); > > /* Enter the function into the hash table. */ > hashval_t hash = instance.hash (); > @@ -1047,16 +1064,14 @@ function_builder::add_unique_function (const function_instance &instance, > > /* Also add the function under its overloaded alias, if we want > a separate decl for each instance of an overloaded function. */ > - if (m_direct_overloads || force_direct_overloads) > + char *overload_name = get_name (instance, true); > + if (strcmp (name, overload_name) != 0) > { > - char *overload_name = get_name (instance, true); > - if (strcmp (name, overload_name) != 0) > - { > - /* Attribute lists shouldn't be shared. */ > - tree attrs = get_attributes (instance); > - add_function (instance, overload_name, fntype, attrs, > - required_extensions, false); > - } > + /* Attribute lists shouldn't be shared. */ > + tree attrs = get_attributes (instance); > + bool placeholder_p = !(m_direct_overloads || force_direct_overloads); > + add_function (instance, overload_name, fntype, attrs, > + required_extensions, false, placeholder_p); > } > > obstack_free (&m_string_obstack, name); > @@ -1077,18 +1092,19 @@ function_builder::add_overloaded_function (const function_instance &instance, > { > char *name = get_name (instance, true); > if (registered_function **map_value = m_overload_names.get (name)) > - gcc_assert ((*map_value)->instance == instance > - && ((*map_value)->required_extensions > - & ~required_extensions) == 0); > + { > + gcc_assert ((*map_value)->instance == instance > + && ((*map_value)->required_extensions > + & ~required_extensions) == 0); > + obstack_free (&m_string_obstack, name); > + } > else > { > registered_function &rfn > = add_function (instance, name, m_overload_type, NULL_TREE, > - required_extensions, true); > - const char *permanent_name = IDENTIFIER_POINTER (DECL_NAME (rfn.decl)); > - m_overload_names.put (permanent_name, &rfn); > + required_extensions, true, m_direct_overloads); > + m_overload_names.put (name, &rfn); > } > - obstack_free (&m_string_obstack, name); > } > > /* If we are using manual overload resolution, add one function decl > @@ -1098,9 +1114,6 @@ void > function_builder::add_overloaded_functions (const function_group_info &group, > mode_suffix_index mode) > { > - if (m_direct_overloads) > - return; > - > unsigned int explicit_type0 = (*group.shape)->explicit_type_suffix_p (0); > unsigned int explicit_type1 = (*group.shape)->explicit_type_suffix_p (1); > for (unsigned int pi = 0; group.preds[pi] != NUM_PREDS; ++pi) > diff --git a/gcc/config/aarch64/aarch64-sve-builtins.h b/gcc/config/aarch64/aarch64-sve-builtins.h > index 620e18841b2..b701f90ac1a 100644 > --- a/gcc/config/aarch64/aarch64-sve-builtins.h > +++ b/gcc/config/aarch64/aarch64-sve-builtins.h > @@ -337,7 +337,8 @@ private: > tree get_attributes (const function_instance &); > > registered_function &add_function (const function_instance &, > - const char *, tree, tree, uint64_t, bool); > + const char *, tree, tree, > + uint64_t, bool, bool); > > /* The function type to use for functions that are resolved by > function_resolver. */ > diff --git a/gcc/testsuite/g++.target/aarch64/sve/pr99216.C b/gcc/testsuite/g++.target/aarch64/sve/pr99216.C > new file mode 100644 > index 00000000000..61a58a7fcf4 > --- /dev/null > +++ b/gcc/testsuite/g++.target/aarch64/sve/pr99216.C > @@ -0,0 +1,5 @@ > +/* { dg-do link { target aarch64_asm_sve_ok } } */ > +/* { dg-additional-options "-flto" } */ > +#include > +bool a; > +int main() { a = svaddv(svptrue_b8(), svdup_s8(0)); } -- Alex