From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2081.outbound.protection.outlook.com [40.107.7.81]) by sourceware.org (Postfix) with ESMTPS id 8F8A13858D20 for ; Tue, 16 Jan 2024 08:21:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8F8A13858D20 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 8F8A13858D20 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.7.81 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1705393316; cv=pass; b=A+w0nRqaGf+9Pq4Q6KVABSVJYc12D+BsRENbD8nbDUAZSF3E2KCkoPUiIbkn+bqvZJXiIV/eaVVzhyoF5y9dqtVQO4OSo2FY1x2PaXiYKoHqwYugZ965GPvYjW/TQGofM4zjqctxlJVeaxH1Qq8mgEO2GgaTpSFp2Zls1bGFCeI= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1705393316; c=relaxed/simple; bh=HKeql9LEDTnRYBH9lowF3XhnP1xpiqjOZi6oNHUzPA8=; h=DKIM-Signature:DKIM-Signature:Date:From:To:Subject:Message-ID: MIME-Version; b=ZaLLkKZpNhJC141eOKuQpwzwfw9HJ0UGI7AE+Bcvjt3bwjIeCG9ar4ZWzLlHLYZuesEVu7EGNcVzC02vAdeZXtRYzAbl+yqXSv1Iel9QVXlyp+D3toeGP6+uOOv5B2MvsH5LGYN5zt9IiHZEnGdmLtwn6Cwlg+h4C5NeN+jIVqo= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=W+5vXljBB5TfCCaRpuOLagGlniL7gkiVXrGX8x+DQhnE4IiVTno+mwxdP9zYtGfzeu54byV8fSZ91YWirfdQawcQoVOjR8mx2Yp6AI9obZVx8cDhejsd2QyEduXa84azF3xq4DCnmAR4HzOruEuG9/UdR1dZLa+IHZzbwH3s+WswGtZWNiJgnUUCiRLXEloo//3lTGqOQqSDVep5mgQszbw66SkSvkBqgRceJXMTmLp4TKBSnlZhazaJ27COO9YuTdek0umV1BAq8p1hFw8E4nkj/xGFIQjujlVBSn8JoBWDHTFWrdgUFdUfuZ/kzLr9GWbPrPmFatdvnw1Z4CkurQ== 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=BKWAS+LtgIFpI39/Z0JclaQE/GG3C0t1ouoUDCWWjGQ=; b=Y9GDWu4zZtL0b+sqZjFE9oPkcVV/hv0oT+I/ChLU/C2DCbw/DWn+vIdPmH9flGh5KNz1zG9fgvXl216yOuc+fWgl+wUisSy1vPAlU7aBIlucFLx+TTDc/y1fmqCNEc28Eq3TONNxbuN8Tgo2ZaU1INzE31pRjZT1CeKrmoXI6hqXgrLbd1w2mWFDddobvnmSQfsF5Yurgtw0DWJwolegDBDRA1Z8fp1+GOTiS5vmXzxCPBHP3e1wOUnDjrK6OIUQZXOJdhCQBkqqs0P3vkjlFIRouU/bLbrAWBXcyjys/KjvznV/Bybjgalcoy90M6DVuYp9+o3lPjOxYAEj9K+pbg== 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=BKWAS+LtgIFpI39/Z0JclaQE/GG3C0t1ouoUDCWWjGQ=; b=L/TcdXQzkYpHURHtx3K7mktR9hlxChVgU6aeZ5DitjAid4Gda6iucxanNtXrErLUUeAulvGGqjWqbHrgt0sv8qQF7Q6mRU/qrbw79Qid4J56sD6WMMIdkFBlwH4YzCkiGm/Ti3J9Zu3rOUE2F6G/5KT2oFNianV+ZwFjGERAblA= Received: from DB9PR05CA0028.eurprd05.prod.outlook.com (2603:10a6:10:1da::33) by AS4PR08MB7455.eurprd08.prod.outlook.com (2603:10a6:20b:4e6::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.28; Tue, 16 Jan 2024 08:21:50 +0000 Received: from DU6PEPF0000B61D.eurprd02.prod.outlook.com (2603:10a6:10:1da:cafe::13) by DB9PR05CA0028.outlook.office365.com (2603:10a6:10:1da::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.28 via Frontend Transport; Tue, 16 Jan 2024 08:21:50 +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 DU6PEPF0000B61D.mail.protection.outlook.com (10.167.8.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7202.16 via Frontend Transport; Tue, 16 Jan 2024 08:21:50 +0000 Received: ("Tessian outbound 1076c872ecc6:v228"); Tue, 16 Jan 2024 08:21:50 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: e141949fe88c4cef X-CR-MTA-TID: 64aa7808 Received: from d5acbfa0db55.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 32D41BF9-F8A9-4D57-A8EC-5C3C0EEDB0D3.1; Tue, 16 Jan 2024 08:21:44 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id d5acbfa0db55.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 16 Jan 2024 08:21:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WNDHhnK1S+MKfZoLzOji3I6AHhlV209rNhLwv4VZttZCUMZvT3ogTB8Ldt4sSAbddel/x2rxFza1EBqoeO8m+xEelVfbkemW73svikYtl4F8jJvuR2pEszjvuvFODX4FgWSk+gPSOy07TguV2qdnbnrgmxv/x3f3IY1QO9Qww3VDrVPrjH9d41LlC/CRg0v/3j3PJef9DDMVtIDJOMaQhXFefVPLWlh0FTS6zx9QulvSK4PAuyCWvucYK01Szy8XS9QySPfIdhcSxnylmyJhXLBFTNJY0Be5hJCcztBsjcOAix7XjpvhrxjM6KI6S9CwalTUJAXzaXUOBIPOmf46CQ== 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=BKWAS+LtgIFpI39/Z0JclaQE/GG3C0t1ouoUDCWWjGQ=; b=mgkR8Jmxm3Onc5xqrRYnynpPLRvYUQAkhABUBJVRAM4Tq+yYQkF3jdFs4VYN8dy2K4jqo5+eSz+A6ojlNvVivNWAwFkx2G7u/BRJ1E4Drfln/8xmjF8upc6nA4Jzua8kDw8dYtmuikB18kbIXQimVwWDgztdz4nqsNtweqLNPmZC6lclp0M21EcT+MbrtzX5sftUiMKdeFz0ESMcPmsgZRSH9KIHRaresQOvr0LO7abAIiVZnLt2ltUIo+FCKT/pLBPJKNralWYw481kVatUBnRJnXlx39ZMmzSdhBzhphi+svmtCS3rqg4kXZKGUgFe5yhTgI18k8UjgPgAdT87Vg== 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=BKWAS+LtgIFpI39/Z0JclaQE/GG3C0t1ouoUDCWWjGQ=; b=L/TcdXQzkYpHURHtx3K7mktR9hlxChVgU6aeZ5DitjAid4Gda6iucxanNtXrErLUUeAulvGGqjWqbHrgt0sv8qQF7Q6mRU/qrbw79Qid4J56sD6WMMIdkFBlwH4YzCkiGm/Ti3J9Zu3rOUE2F6G/5KT2oFNianV+ZwFjGERAblA= 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 DB9PR08MB9729.eurprd08.prod.outlook.com (2603:10a6:10:45c::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.23; Tue, 16 Jan 2024 08:21:40 +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.027; Tue, 16 Jan 2024 08:21:40 +0000 Date: Tue, 16 Jan 2024 08:21:37 +0000 From: Andrew Carlotti To: Richard Biener Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH 2/5] tree: Extend DECL_FUNCTION_VERSIONED to an enum Message-ID: <0e88d4f6-ce04-2a4a-9e17-918794368798@e124511.cambridge.arm.com> References: <149a20f9-2f84-fb38-9cfb-1de2c38a39d6@e124511.cambridge.arm.com> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-ClientProxiedBy: LO4P123CA0583.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:276::13) To AS8PR08MB6678.eurprd08.prod.outlook.com (2603:10a6:20b:398::8) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: AS8PR08MB6678:EE_|DB9PR08MB9729:EE_|DU6PEPF0000B61D:EE_|AS4PR08MB7455:EE_ X-MS-Office365-Filtering-Correlation-Id: e33f8e7f-9b56-4549-ca67-08dc166c3082 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: 3U7wUO4RvYKoCYBjWyNOCrBa4DAQYcj1WNjyVMTLgE2A7AdE7UKPd66x+QRreHb6ICcLgBGm1P6+4KLgVDuthoRvaWhH24WQeanxIfPyGx4lhdtq6wJERAjzpwVph1uM36A4fwHnFSzs6zFwHhL9JqRea+YY2o5c4YvrEE2u9uC8pq2zbfxacrVz/oNuqvmGlwuadcQBy01VS8nCnHTYXN2iTvX4LxN5oMJgKTaeIatGWDY+V0A2Oiyy6+o6id9TAktkHPU1uCexMW/Ep8sZd4Uj/5h2SqFo1Hjp+m2OrBZId7MEgXo+uv2nApvDHppOLR9wCrblUnUxGian+Bv7hlacAo+5ekdQIoKR/hMWTkkhZf2M2hNrzMmVRfG7cux9+Fvwa/to946twqKtHYSiWuCzhfPeXEUHSGLEJ8lqcDVxXutcC8P9lTM+c54ZInuuMYoejOHB/iQsRqCWyLIihhqta9VkrKjFSZE9KulTMaKpxlF3v3MaYiXC2poDBpBFIGQOPdrVWD2pRetHEr1rsNbs64ra+eO8e76KUpbNHwt23BzA7RqCiybybNZWZiHw 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)(346002)(376002)(366004)(396003)(39860400002)(136003)(230922051799003)(186009)(64100799003)(451199024)(1800799012)(6666004)(8936002)(316002)(8676002)(478600001)(83380400001)(6486002)(6916009)(6512007)(53546011)(6506007)(26005)(66574015)(66476007)(66556008)(66946007)(5660300002)(2906002)(44832011)(4326008)(41300700001)(38100700002)(86362001)(31686004)(31696002);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB9729 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: DU6PEPF0000B61D.eurprd02.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 08072b38-b229-4dd7-ad73-08dc166c2a88 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GRFLEnG0Z3UbUIYoYQ5bUvxiP73vjPlNkthfG7J3B63bBzpJ/BLvVs6Ork2EOo/beS/IyFd7vadJ+6GbveAh5gAy80ey4lr2xG4NqdijND2mrB9AmawpwGwbfc+ny55Atr7YlNp7Ugg/hirRBqoKn+xUbZ2tvRRtyD/xiZcxyw6fTzx86P7YIuQ5tBH+YwP7gfpHRFrwdxSoTW0nEBMlPhVqtDmOcbvbZX7cK4wnKUEEN6kBLZYwK96jPCgmIEP3l06kSKPUuTtknoI22B0Xh+095KAwv40SyzOoSzTwFHhD1Zvrof48tjZHDqKJn//ICjiWG1jzdTRfFCmvZw3O2pWxHxjT02rjm2kFGXIhvlMWk1w09+zEqkZr0uQeADlvuZs9omNrCOLRHXN2+xMmiC6sda5c5KClZd2x4tLvlHbEw71kk1oSMW9Q9anzOSvne6EpVCNx3W3QmJurCSW3bXx1IoXHzJozQSerJEdVF+RR3jO4p1ZHYWfKEAWieqkRSi9Dzg9172ndtzoXlMk87GDvjBoqFRCiUhQFLXE9LqbyWyQLElc8DTrg656Zl1XEgdsSSzyleAADet+2jjBLhCiKe1pTGgrBtfMx0YZ0u9shhWvKeqdjDxNh0vrGGjGUfnSPi6EJP5REIArozo5qOKIe5p9tHXGOfDH0g9GkwHqt4B+V6vCa0bKORmdM69GBpmJSTcGapDiWDjyT3KeQjxN40JQbedKXwGV+KPn5qWpzGSvxp0iHvDq8iR5VKGpk 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)(376002)(346002)(39860400002)(396003)(136003)(230922051799003)(451199024)(1800799012)(82310400011)(186009)(64100799003)(46966006)(36840700001)(40470700004)(83380400001)(47076005)(336012)(26005)(66574015)(36860700001)(316002)(6862004)(70586007)(4326008)(8676002)(5660300002)(70206006)(44832011)(8936002)(6666004)(6512007)(6506007)(53546011)(2906002)(6486002)(478600001)(356005)(31696002)(86362001)(82740400003)(81166007)(41300700001)(31686004)(40480700001)(40460700003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jan 2024 08:21:50.5924 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e33f8e7f-9b56-4549-ca67-08dc166c3082 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: DU6PEPF0000B61D.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR08MB7455 X-Spam-Status: No, score=-9.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,GIT_PATCH_0,KAM_DMARC_NONE,KAM_LOTSOFHASH,RCVD_IN_BL_SPAMCOP_NET,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,URIBL_BLACK 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: On Mon, Jan 15, 2024 at 01:28:04PM +0100, Richard Biener wrote: > On Mon, Jan 15, 2024 at 12:27 PM Andrew Carlotti > wrote: > > > > This allows code to determine why a particular function is > > multiversioned. For now, this will primarily be used to preserve > > existing name mangling quirks when subsequent commits change all > > function multiversioning name mangling to use explicit target hooks. > > However, this can also be used in future to allow more of the > > multiversioning logic to be moved out of target hooks, and to allow > > targets to simultaneously enable multiversioning with both 'target' and > > 'target_version' attributes. > > Why does module.cc need to stream the bits? target_clone runs long > after the FE finished. Instead I wonder why LTO doesn't stream the bits > (tree-streamer-{in,out}.cc)? > > You have four states but only mention 'target' and 'target_version', what's the > states actually? Can you amend the function_version_source enum > comment accordingly? All four states are used, although currently not all within a single target, and in many places you could also work out whether you're in the "target_clones" case or the "target"/"target_version" case based upon whether you're in the frontend code or the target_clone pass. So perhaps the second bit can be made redundant in most places, but it's useful in some parts of the code. The main benefits of this design are: - that it allows backend target hooks to distinguish between the different causes of function multiversioning without having to create separate hooks, or pass an extra argument down the call stack; - that it allows a backend to choose to support mutltiversioning with both "target" and "target_version" attributes (I remember Martin Liška suggested supporting "target_version" on x86 as well, and it could provide a way to improve how multiversioning works without running into backwards compatibility issues for the "target" attribute). > This looks like stage1 material to me. I considered it as stage 3 material, because it fixes a bug on aarch64 (where the existing code didn't comply with the ACLE spec, and would have cause problems when applied to public symbols). Admittedly, I did miss the end of stage 3 by a couple of days; I hadn't realised how early stage 4 began, and spent the last couple of weeks focussing on Binutils work instead. However, I've now realised that I can fix this bug entirely within the aarch64 backend (by overwriting the incorrect mangling applied in target-agnostic code). I'll send out that patch later today, which should hopefully be more acceptable at this stage. Thanks, Andrew > Thanks, > Richard. > > > gcc/ChangeLog: > > > > * multiple_target.cc (expand_target_clones): Use new enum value. > > * tree-core.h (enum function_version_source): New enum. > > (struct tree_function_decl): Extend versioned_function to two > > bits. > > > > gcc/cp/ChangeLog: > > > > * decl.cc (maybe_mark_function_versioned): Use new enum value. > > (duplicate_decls): Preserve DECL_FUNCTION_VERSIONED enum value. > > * module.cc (trees_out::core_bools): Use two bits for > > function_decl.versioned_function. > > (trees_in::core_bools): Ditto. > > > > > > diff --git a/gcc/cp/decl.cc b/gcc/cp/decl.cc > > index b10a72a87bf0a1cabab52c1e4b657bc8a379b91e..527931cd90a0a779a508a096b2623351fd65a2e8 100644 > > --- a/gcc/cp/decl.cc > > +++ b/gcc/cp/decl.cc > > @@ -1254,7 +1254,10 @@ maybe_mark_function_versioned (tree decl) > > { > > if (!DECL_FUNCTION_VERSIONED (decl)) > > { > > - DECL_FUNCTION_VERSIONED (decl) = 1; > > + if (TARGET_HAS_FMV_TARGET_ATTRIBUTE) > > + DECL_FUNCTION_VERSIONED (decl) = FUNCTION_VERSION_TARGET; > > + else > > + DECL_FUNCTION_VERSIONED (decl) = FUNCTION_VERSION_TARGET_VERSION; > > /* If DECL_ASSEMBLER_NAME has already been set, re-mangle > > to include the version marker. */ > > if (DECL_ASSEMBLER_NAME_SET_P (decl)) > > @@ -3159,7 +3162,7 @@ duplicate_decls (tree newdecl, tree olddecl, bool hiding, bool was_hidden) > > && DECL_FUNCTION_VERSIONED (olddecl)) > > { > > /* Set the flag for newdecl so that it gets copied to olddecl. */ > > - DECL_FUNCTION_VERSIONED (newdecl) = 1; > > + DECL_FUNCTION_VERSIONED (newdecl) = DECL_FUNCTION_VERSIONED (olddecl); > > /* newdecl will be purged after copying to olddecl and is no longer > > a version. */ > > cgraph_node::delete_function_version_by_decl (newdecl); > > diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc > > index aa75e2809d8fdca14443c6b911bf725f6d286d20..ba60d0753f91ef91d45fb5d62f26118be4e34840 100644 > > --- a/gcc/cp/module.cc > > +++ b/gcc/cp/module.cc > > @@ -5473,7 +5473,11 @@ trees_out::core_bools (tree t) > > WB (t->function_decl.looping_const_or_pure_flag); > > > > WB (t->function_decl.has_debug_args_flag); > > - WB (t->function_decl.versioned_function); > > + > > + /* versioned_function is a 2 bit enum. */ > > + unsigned vf = t->function_decl.versioned_function; > > + WB ((vf >> 0) & 1); > > + WB ((vf >> 1) & 1); > > > > /* decl_type is a (misnamed) 2 bit discriminator. */ > > unsigned kind = t->function_decl.decl_type; > > @@ -5618,7 +5622,12 @@ trees_in::core_bools (tree t) > > RB (t->function_decl.looping_const_or_pure_flag); > > > > RB (t->function_decl.has_debug_args_flag); > > - RB (t->function_decl.versioned_function); > > + > > + /* versioned_function is a 2 bit enum. */ > > + unsigned vf = 0; > > + vf |= unsigned (b ()) << 0; > > + vf |= unsigned (b ()) << 1; > > + t->function_decl.versioned_function = function_version_source (vf); > > > > /* decl_type is a (misnamed) 2 bit discriminator. */ > > unsigned kind = 0; > > diff --git a/gcc/multiple_target.cc b/gcc/multiple_target.cc > > index 1fdd279da04a7acc5e8c50f528139f19cadcd5ff..56a1934fe820e91b2fa451dcf6989382c906b98c 100644 > > --- a/gcc/multiple_target.cc > > +++ b/gcc/multiple_target.cc > > @@ -383,7 +383,7 @@ expand_target_clones (struct cgraph_node *node, bool definition) > > if (decl1_v == NULL) > > decl1_v = node->insert_new_function_version (); > > before = decl1_v; > > - DECL_FUNCTION_VERSIONED (node->decl) = 1; > > + DECL_FUNCTION_VERSIONED (node->decl) = FUNCTION_VERSION_TARGET_CLONES; > > > > for (i = 0; i < attrnum; i++) > > { > > @@ -421,7 +421,8 @@ expand_target_clones (struct cgraph_node *node, bool definition) > > > > before->next = after; > > after->prev = before; > > - DECL_FUNCTION_VERSIONED (new_node->decl) = 1; > > + DECL_FUNCTION_VERSIONED (new_node->decl) > > + = FUNCTION_VERSION_TARGET_CLONES; > > } > > > > XDELETEVEC (attrs); > > diff --git a/gcc/tree-core.h b/gcc/tree-core.h > > index 8a89462bd7ecac52fcdc11c0b57ccf7c190572b3..e159d53f9d11ba848c49499aa963daa2fbcbc648 100644 > > --- a/gcc/tree-core.h > > +++ b/gcc/tree-core.h > > @@ -1955,6 +1955,19 @@ enum function_decl_type > > /* 0 values left */ > > }; > > > > +/* Enumerate function multiversioning attributes. This is used to record which > > + attribute enabled multiversioning on a function, and allows targets to > > + adjust their behaviour accordingly. */ > > + > > +enum function_version_source > > +{ > > + FUNCTION_VERSION_NONE = 0, > > + FUNCTION_VERSION_TARGET = 1, > > + FUNCTION_VERSION_TARGET_CLONES = 2, > > + FUNCTION_VERSION_TARGET_VERSION = 3 > > +}; > > + > > + > > /* FUNCTION_DECL inherits from DECL_NON_COMMON because of the use of the > > arguments/result/saved_tree fields by front ends. It was either inherit > > FUNCTION_DECL from non_common, or inherit non_common from FUNCTION_DECL, > > @@ -2002,10 +2015,10 @@ struct GTY(()) tree_function_decl { > > /* Align the bitfield to boundary of a byte. */ > > ENUM_BITFIELD(function_decl_type) decl_type: 2; > > unsigned has_debug_args_flag : 1; > > - unsigned versioned_function : 1; > > + ENUM_BITFIELD(function_version_source) versioned_function : 2; > > unsigned replaceable_operator : 1; > > > > - /* 11 bits left for future expansion. */ > > + /* 10 bits left for future expansion. */ > > /* 32 bits on 64-bit HW. */ > > }; > >