From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 785A43858D20 for ; Thu, 14 Dec 2023 22:09:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 785A43858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 785A43858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702591752; cv=none; b=LJdqa/OjEvu+sS/oBtrZ2kgUlT3kkx7VgPVx6u+uDIgR3TwtwL4jnam5Bq7sSinH9u1rTQzt91Va8XXDQkbNlyOOd03HgZEWHOseJfzxle9/HVqdbbfw9BEjcIJyCpP+9U5HUoMJdbmYg0cWtJk2c5mVrc1kILaGvQyVVaamfK4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702591752; c=relaxed/simple; bh=xI09MHedAHVq62IAm4V30dn/C/3vnw3rLDaUjq5iN1E=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=sdhMCsGqorojLmAYfORrIMp6q1BkpPcuiakK6ZbYeh4W6SLDABFxnlKchIhkBYiKuX/2wqfco4IrSjssTtL9kBCz0BSQnQagtTut7TBc8cL7r9b4IoYZp7IgW/96EVRNya+S1OR9oPfhdkeRyl85pYZppzrxBTpgY5TtdhyCDVk= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702591748; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5BMqGRLLFSzQvVFSD7Jsp5f1ZfPuPPHXlNdklA+hh1M=; b=LqgM/U/cK/jPUPlbmKMckezzp9OkhXodjiIqbiX8Rw1LDhBKeXqwt9OXyH788BBlT5omh7 dOf1w7N7+oQiieM/6ai9rTdqZtdWICbZRRZHDxgjRcdA+dMxSf3XuMBwA6m3CuxgxVpnKZ WBZ5cMVYOqZx5bZ8NpFsS433I8JUZDU= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-602-qcZz2rAHOzySInLu_xtOww-1; Thu, 14 Dec 2023 17:09:06 -0500 X-MC-Unique: qcZz2rAHOzySInLu_xtOww-1 Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-67f04cb591eso368206d6.3 for ; Thu, 14 Dec 2023 14:09:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702591746; x=1703196546; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=5BMqGRLLFSzQvVFSD7Jsp5f1ZfPuPPHXlNdklA+hh1M=; b=RtiK6uTo1CYKt6Hto8IXOyT90Cl6JvaSlRChkip6YS+bn1hapgSqRZ4UQBqDRl9791 pukErnty6ciA2jlo8aAgixv5gdED6BqYhQEql8Rbvsv2DgB8qWZ6N9ER1I9ERN4DJDFG clq+h/GHuT4xfo2j4SAcnL5bUX3hRZjSGuFdJ7Me7XOjEiFx7+G7CQiTL5/0C3qkWNOI U6ZEIXzCClEOkqQObtuCbhCJOhIidN8lEPvUTDAk104kcPR7L4XE/VfNe4nwRX292Rd5 9EMuQD6HM3/3oL9rEIMBUaMyDYDLSJCPsS9KETDiO+fTFtOn2TycCu9LRL1tQWa8hx/u KC8Q== X-Gm-Message-State: AOJu0Yy3TcV3fF5aQrYF2ulkebra+TIwNxeuh7G4qeSeW04nS8UgwWNb DLF/RpFoCidnaowiSK6GV7u1mup+mlUHZUSt0w+VskpjXgFcYB5f7yIElLo4ZDzyfzL9sDaNhxN 98WCCqEZ3FkIWIKV7jQ== X-Received: by 2002:a05:6214:1bcd:b0:67f:14cf:9ade with SMTP id m13-20020a0562141bcd00b0067f14cf9ademr722351qvc.60.1702591746252; Thu, 14 Dec 2023 14:09:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IFt3HN/+HSBj0sixNhAXSHnIwzkdpZ9I9G3o/V05+GeqqF5AVeK2B14tdAyHygIFHK9noKnjQ== X-Received: by 2002:a05:6214:1bcd:b0:67f:14cf:9ade with SMTP id m13-20020a0562141bcd00b0067f14cf9ademr722337qvc.60.1702591745924; Thu, 14 Dec 2023 14:09:05 -0800 (PST) Received: from [192.168.1.146] (130-44-146-16.s12558.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [130.44.146.16]) by smtp.gmail.com with ESMTPSA id db7-20020a056214170700b0067a8fe21448sm2358476qvb.2.2023.12.14.14.09.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 14 Dec 2023 14:09:05 -0800 (PST) Message-ID: <168ac308-cc1e-43af-8f96-19fab9dddfa8@redhat.com> Date: Thu, 14 Dec 2023 17:09:04 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] c++: abi_tag attribute on templates [PR109715] To: Patrick Palka Cc: gcc-patches@gcc.gnu.org References: <20231214191719.1941342-1-ppalka@redhat.com> <7ded5b9e-4718-4a48-9d18-5a88321d2163@redhat.com> <49477513-edfe-7ab6-95d6-7ea3496707ac@idea> From: Jason Merrill In-Reply-To: <49477513-edfe-7ab6-95d6-7ea3496707ac@idea> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE 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 12/14/23 16:08, Patrick Palka wrote: > On Thu, 14 Dec 2023, Jason Merrill wrote: > >> On 12/14/23 14:17, Patrick Palka wrote: >>> Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for >>> trunk? Do we want to condition this on abi_check (19)? >> >> I think we do, sadly. > > Sounds good, like so? Bootstrap and regtest in progress. > > -- >8 -- > > Subject: [PATCH] c++: abi_tag attribute on templates [PR109715] > > As with other declaration attributes, we need to look through > TEMPLATE_DECL when looking up the abi_tag attribute. > > PR c++/109715 > > gcc/cp/ChangeLog: > > * mangle.cc (get_abi_tags): Look through TEMPLATE_DECL. > > gcc/testsuite/ChangeLog: > > * g++.dg/abi/abi-tag25.C: New test. > * g++.dg/abi/abi-tag25a.C: New test. > --- > gcc/cp/mangle.cc | 6 ++++++ > gcc/testsuite/g++.dg/abi/abi-tag25.C | 17 +++++++++++++++++ > gcc/testsuite/g++.dg/abi/abi-tag25a.C | 11 +++++++++++ > 3 files changed, 34 insertions(+) > create mode 100644 gcc/testsuite/g++.dg/abi/abi-tag25.C > create mode 100644 gcc/testsuite/g++.dg/abi/abi-tag25a.C > > diff --git a/gcc/cp/mangle.cc b/gcc/cp/mangle.cc > index 0684f0e6038..e3383df1836 100644 > --- a/gcc/cp/mangle.cc > +++ b/gcc/cp/mangle.cc > @@ -530,6 +530,12 @@ get_abi_tags (tree t) > if (DECL_P (t) && DECL_DECLARES_TYPE_P (t)) > t = TREE_TYPE (t); > > + if (TREE_CODE (t) == TEMPLATE_DECL > + && DECL_TEMPLATE_RESULT (t) > + /* We used to ignore abi_tag on function and variable templates. */ > + && abi_check (19)) > + t = DECL_TEMPLATE_RESULT (t); Generally I try to call abi_check only when we know that there's something that will change the mangling, so here only if the template has ABI tags. I suppose the only downside is a second mangling that produces the same name and gets ignored in mangle_decl so we don't need to be too strict about it, but it shouldn't be too hard to do that here? Jason