From patchwork Tue Dec 12 19:29:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Xu X-Patchwork-Id: 177530 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp7953892vqy; Tue, 12 Dec 2023 11:30:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IFNZVE1qs5xjB/lEGehju9plh8hCiv4WJghKH3lu4WyPg7bIif9sJAGvYF0y8r7s2HpUFvJ X-Received: by 2002:a05:622a:1c1:b0:425:5337:3d04 with SMTP id t1-20020a05622a01c100b0042553373d04mr9056863qtw.25.1702409414270; Tue, 12 Dec 2023 11:30:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1702409414; cv=pass; d=google.com; s=arc-20160816; b=BX0t/Se+K2jkUHz+fv3N6L9GSxCAzPEgOMStkQ3X0K34hRcQoO6vXg3QMpnoco5j2t Qt3YwWUqYwyvsNvK5S8gwr+j6PmERH/tQMytJ11WctR49cqrChvKQ4hY++jzLzeF10pn DxospfEYx5ycbLZ6lXh6JYWAxaeSeXUBIjKrDOj1HgLBA4KDwPpYHp6saEn9OPyTfi/A /tKfPuE5HWCsnrFbjAKJmIwd2hAX0hbVa5mCUh0JKT6Vy2lyzxYgVwqfLLqAgws42lYW HMkBnnvPQWttteuV+0Tc8hUImdc9uOB0XyWafI++ydHqULeLKWm1Gdcg3DzmWvAp6hZx oQpQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:ppout:mime-version :content-transfer-encoding:content-language:accept-language :message-id:date:thread-index:thread-topic:subject:to:from :arc-filter:dmarc-filter:delivered-to; bh=ywVilmMeaZ3oZ+cOzugOR20kY0xrpiDTTS7zLajr7J4=; fh=XNn3asQvIblazGK92GBt13dVv+YmGV3pBS0JC29ZQco=; b=yNzMhQVQeg6FKvuDaNr0NFopnBfiI6PQ4E0Njis/RyxwpSOtYfqsRokKTtwb7IkEGs U9FQMUP0aKvekskWdKS1TgpBG8lX3hZhoouN1esS/5ad/+Aoqc1I6D0SfHyrkgsLxgaX Y45QXfttMQIMonzckDkzLY3vZy8khaWerXQa3nfY9mkETPDOKRkGWEqKC01dPLyPB3Ox FoE5r0TPi6SbAEw+IIp5GRWX/TiErQ1S0TiUJhXKpufAW30WtvkBONp56l7V2wmTkEbG 9M8CVP1KwuisammTLD86zuZQs5Dh9Ax16+GCpfuFWGCwx33OyxjPcU35/16OdLG8RO28 8YAw== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=drwholdings.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id cn10-20020a05622a248a00b0042583f2861esi11845800qtb.534.2023.12.12.11.30.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 11:30:14 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=drwholdings.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0FDBF3857C7A for ; Tue, 12 Dec 2023 19:30:14 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-00579801.pphosted.com (mx0b-00579801.pphosted.com [205.220.178.60]) by sourceware.org (Postfix) with ESMTPS id 9A4C53858000 for ; Tue, 12 Dec 2023 19:29:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9A4C53858000 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=DRWHoldings.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=DRWHoldings.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 9A4C53858000 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=205.220.178.60 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702409384; cv=none; b=ijOk6aLUxB+t9Csm3FzxQj4ZLugWdplXZZDa3ykeIpTeh5kBn8iLjKpfMTbnAia5HrFSovX/2w2iO3NPpdmT0UIocL/OkVDFys1nAYuDzAm8pq1ozM7SS6JOXnPZUz99A3qeXWHiT7Q9z0f+BDALkldKlth80K7wtjrlWb9vWEM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702409384; c=relaxed/simple; bh=37Yv5SYqb+l9srzUZJX/ASEqzDWfKR+BJRp9grsW1cg=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=JJSsAbO3iq0kzwWpAWWjRWMs2J6N5w9UmmUGzNP49nP5h22wvmJPVCIBBFfbB+YIBcsWgLAkEff9v3hJGFNWQDu6hZnhuc65n38ZwKOv3WPlewqnyXTcAdGwCx8HSZEZevVKvO5MsQ26s4wT16LTIfNN30tbmvyNjod4B2Zd9Xg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0223521.ppops.net [127.0.0.1]) by mx0a-00579801.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BCIx13u001131 for ; Tue, 12 Dec 2023 19:29:43 GMT Received: from smtpext-chi.drwholdings.com ([74.119.41.71]) by mx0a-00579801.pphosted.com (PPS) with ESMTPS id 3uxsnj0j7t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 12 Dec 2023 19:29:42 +0000 (GMT) Received: from CHHQ-SWPEXCH01.US.DRWHoldings.com (10.8.35.74) by smtpext-chi.drwholdings.com (172.17.200.171) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.1118.20; Tue, 12 Dec 2023 13:29:42 -0600 Received: from ln1x-swpexch04.US.DRWHoldings.com (10.95.52.117) by CHHQ-SWPEXCH01.US.DRWHoldings.com (10.8.35.74) with Microsoft SMTP Server (TLS) id 15.0.1497.38; Tue, 12 Dec 2023 13:29:41 -0600 Received: from ln1x-swpexch03.US.DRWHoldings.com (10.95.52.116) by ln1x-swpexch04.US.DRWHoldings.com (10.95.52.117) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.20; Tue, 12 Dec 2023 19:29:40 +0000 Received: from ln1x-swpexch03.US.DRWHoldings.com ([10.95.52.116]) by ln1x-swpexch03.US.DRWHoldings.com ([10.95.52.116]) with mapi id 15.02.1118.020; Tue, 12 Dec 2023 19:29:40 +0000 From: Jason Xu To: "gcc-patches@gcc.gnu.org" Subject: [PATCH] c++: Fix warmth propagation for member function templates Thread-Topic: [PATCH] c++: Fix warmth propagation for member function templates Thread-Index: AQHaLS7k4/HXjMbPik64Lttt+UUUTw== Date: Tue, 12 Dec 2023 19:29:40 +0000 Message-ID: Accept-Language: en-GB, en-US Content-Language: en-GB X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.8.40.51] MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: fMtPbikbC6Lbvb_MZ3-4NN8rpoyhzwZt X-Proofpoint-GUID: fMtPbikbC6Lbvb_MZ3-4NN8rpoyhzwZt ppout: true X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-28_27,2023-11-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 phishscore=0 clxscore=1011 malwarescore=0 lowpriorityscore=0 mlxlogscore=751 suspectscore=0 mlxscore=0 priorityscore=1501 spamscore=0 bulkscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2312120148 X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, T_SCC_BODY_TEXT_LINE, 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 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+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785105654258315895 X-GMAIL-MSGID: 1785105654258315895 Support was recently added for class-level warmth attributes that are propagated to member functions. The current implementation ignores member function templates and this patch fixes that. gcc/cp/ChangeLog: * class.cc (propagate_class_warmth_attribute): fix warmth propagation for member function templates --- gcc/cp/class.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) -- 2.40.0 This e-mail and any attachments may contain information that is confidential and proprietary and otherwise protected from disclosure. If you are not the intended recipient of this e-mail, do not read, duplicate or redistribute it by any means. Please immediately delete it and any attachments and notify the sender that you have received it by mistake. Unintended recipients are prohibited from taking action on the basis of information in this e-mail or any attachments. The DRW Companies make no representations that this e-mail or any attachments are free of computer viruses or other defects. diff --git a/gcc/cp/class.cc b/gcc/cp/class.cc index 6fdb56abfb9..68e0f2e9e13 100644 --- a/gcc/cp/class.cc +++ b/gcc/cp/class.cc @@ -7805,8 +7805,13 @@ propagate_class_warmth_attribute (tree t) if (class_has_cold_attr || class_has_hot_attr) for (tree f = TYPE_FIELDS (t); f; f = DECL_CHAIN (f)) - if (TREE_CODE (f) == FUNCTION_DECL) -maybe_propagate_warmth_attributes (f, t); + { +tree real_f = f; +if (TREE_CODE (f) == TEMPLATE_DECL) + real_f = DECL_TEMPLATE_RESULT (f); +if (TREE_CODE (real_f) == FUNCTION_DECL) + maybe_propagate_warmth_attributes (real_f, t); + } } tree