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 8EA723858D35 for ; Wed, 28 Jun 2023 15:50:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8EA723858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687967415; 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=jVsUsevPkB5/cdjj3gHDZZO70Ls5JWc+cA2Y7IP1Zzs=; b=FjlyjI+BZP0blU9aaqtPyEPIj2tEo11TPZP2bC+SjRjh7E+BtmqQScuzQOitam04B+0hkz b3lesquustsUBu0KPS6qx0n8fPI0ThaasD6RNjf9tEjkb767mibD72Xm6yQReodnN6Br1v VtViuHnl+xCnOEquKttqVsmFnaNgK2E= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-492-tOT93mDmPlKna7A2pzgvwA-1; Wed, 28 Jun 2023 11:50:12 -0400 X-MC-Unique: tOT93mDmPlKna7A2pzgvwA-1 Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-7659c6caeaeso423322685a.3 for ; Wed, 28 Jun 2023 08:50:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687967411; x=1690559411; 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=jVsUsevPkB5/cdjj3gHDZZO70Ls5JWc+cA2Y7IP1Zzs=; b=lCyTs7BrFZHMWhaf4+AScAMPyf/vmqX0xw5FfM936L0or8391btz+DJqkU5gggDD+p h8Ng6e+6x2XS+N+LqQYQACjweR9avICECD4Z7Es53Jsy3Bi2fA85eyvKnS7dg5YHlQxD NTIPKLxUIMihWZf6LmcOcPqr/eGqQtZ04mFGSPZGVM/o7Z3LdjUZl7lHYxfY0Ysq8PCH FUuF5OsCVmU+qH3V3tRvEvWiPjA26N7VyA+mP2VS544VhlKzgkFkiuWa2sTtQ6nt57SH jkegfzaFuyJW4IdTYB4erOUyk+TwNdKrvy3UcUa9wu95Wxn1hKcwv3cbAqDv0NpRg8xB VWEg== X-Gm-Message-State: AC+VfDzmFE7x7z8X91E+ZZmYD37NhuiszJ+7hVYXLoHFChmuPNwfHIN6 gQ3doRKa632dsgWIjDCL7Kxj5slaYEXZloEWHqrOHOfsa/GObemNf4rtYAOLNMGArZUSFO0MIUI ru2wjx8SgOVWGkJqN8gQUltyIWQ== X-Received: by 2002:a05:620a:290a:b0:765:4a75:fd61 with SMTP id m10-20020a05620a290a00b007654a75fd61mr21311959qkp.54.1687967411120; Wed, 28 Jun 2023 08:50:11 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4C/jAfM1SwpKNWY2sptCMTERJmXrfx5QncTTQKe4gwdPSAyOEtvVwhPYF66Y6394zh+A+ibQ== X-Received: by 2002:a05:620a:290a:b0:765:4a75:fd61 with SMTP id m10-20020a05620a290a00b007654a75fd61mr21311944qkp.54.1687967410881; Wed, 28 Jun 2023 08:50:10 -0700 (PDT) Received: from [192.168.1.108] (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 i2-20020a05620a150200b00759300a1ef9sm2492049qkk.31.2023.06.28.08.50.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 28 Jun 2023 08:50:10 -0700 (PDT) Message-ID: <26258d18-5718-9387-087b-be58a25048c2@redhat.com> Date: Wed, 28 Jun 2023 11:50:09 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH] c++: redundant targ coercion for var/alias tmpls To: Patrick Palka Cc: gcc-patches@gcc.gnu.org References: <20230621171920.1283054-1-ppalka@redhat.com> <94b29e42-dfa9-5c05-4f1d-3c5beb998fdf@redhat.com> From: Jason Merrill In-Reply-To: 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=-6.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_SHORT,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5,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 6/23/23 12:23, Patrick Palka wrote: > On Fri, 23 Jun 2023, Jason Merrill wrote: > >> On 6/21/23 13:19, Patrick Palka wrote: >>> When stepping through the variable/alias template specialization code >>> paths, I noticed we perform template argument coercion twice: first from >>> instantiate_alias_template / finish_template_variable and again from >>> tsubst_decl (during instantiate_template). It should suffice to perform >>> coercion once. >>> >>> To that end patch elides this second coercion from tsubst_decl when >>> possible. We can't get rid of it completely because we don't always >>> specialize a variable template from finish_template_variable: we could >>> also be doing so directly from instantiate_template during variable >>> template partial specialization selection, in which case the coercion >>> from tsubst_decl would be the first and only coercion. >> >> Perhaps we should be coercing in lookup_template_variable rather than >> finish_template_variable? > > Ah yes, there's a patch for that at > https://gcc.gnu.org/pipermail/gcc-patches/2023-May/617377.html :) So after that patch, can we get rid of the second coercion completely? Jason