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 758A53858D20 for ; Thu, 25 Apr 2024 15:30:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 758A53858D20 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 758A53858D20 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=1714059054; cv=none; b=QdOk4lWCtVNRgWLjmw25wZw4s941ublqe4rTsMm4WhaycAoWlLkbO3MjMp+0bVwLyITcu+2hdTqQPd2AguAFCSrS6sMESsWVSullm8Ug65JA9ewAx7eEF1pckJVOEPaB56o4nqZbxbPRa2i9Dl/lYvp+IzVXPuLrjs/y5qYrcRY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714059054; c=relaxed/simple; bh=XXA/2Cw2JNkjU/5e4uAWpvDg7UAMLA2tBp39tVImwzU=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=mI/rZ/HkwXyJYYWxmHbQ+6WAmhBRu3BTVpM2bTZW2Hru3ygd6kT15baEzS4MDfAmVLGHqecAAvgKn3ZfinbpccwkEzPRJwuOccP0WGpz908vxHw8KOjsY4FRJvH96Eue/jKbdDM6L3Ui6m0W/FCgC98y/UOEDf85EeSmbZkwiMg= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714059053; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+Y0iWy839+AwvCaAtuHgTXYOzHGq6t3edqTSCP43B0Q=; b=M+daAxVvg5DAqCY4ZixibFTFKuJjsdvkENV+WNVeuhIMbGzrH8l9QvSoyxVSTSQrL1WS+i W8SkfcyPOZ06gj6wHR48beykpn6rKdTclpCeSbeloS1v3b75mXTctozNONE6YHCA/xN3Vu XGx8z1/Ej3hVoMy4V9ktmrlgyhonXbU= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-678-ZNLQwwSWNmOmLIPIAEhYjQ-1; Thu, 25 Apr 2024 11:30:51 -0400 X-MC-Unique: ZNLQwwSWNmOmLIPIAEhYjQ-1 Received: by mail-qt1-f198.google.com with SMTP id d75a77b69052e-434e823ba24so12642051cf.2 for ; Thu, 25 Apr 2024 08:30:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714059051; x=1714663851; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+Y0iWy839+AwvCaAtuHgTXYOzHGq6t3edqTSCP43B0Q=; b=YVtUQ4aLzKk2FfOq2rP+xYAdee0MHH0yl6kPRgdmTO6JKTiDUwxdjVOuAji/ZpR4SB Hm4i/qvyrFb+iHpEvFrfhmyny4TPEMTJ4mvvUzu3cb9jmB8CKXHIlI9njIl45XdB87x8 M+ZcOjFqK21Od0UkiohIT/NXkM4sXi2Lr0IycHdiF5xHpEWAlJfTdq/WdSGDX18iAyoW BO7f1UuOp5lvgRCkn3b+nr4EVL4hvROlXjpVTh9r5KLgELliBqy7MyV+GaOpstUA1dTu 4KlO8Kja6+vqhDohok9tLg6EP/j7PQaw8ygpPKDcMczLB8ZbuTCY9l+BqnNBE1nnW1Og 7QSQ== X-Forwarded-Encrypted: i=1; AJvYcCXMPGYzN5LhKVBfKKRxHYBxJKNKNzHAxe8OVwgULov4cuoPc8uVYI7UkUz9XtF6bviwId+k4hJ7x29aRQuuVhcxOennLqe37A== X-Gm-Message-State: AOJu0Yz//V6ldEVFwPPY/pCIe7IC8iX2IgpLhRqjyCU91OqqzE8Wb6I6 vkjbo/ld48MWTKXjS6vHrTjWmdmhYU4OmdPE2dK+5hr1EAGEba/zSqEot5OkDiFurd0X+tufohO W+O2A2iI7mNbk1yN944xjDOK+cabe3z6XQUkKJ2TQ1LZIYuvwnq7Mw2I= X-Received: by 2002:ac8:57c8:0:b0:43a:47d7:49a8 with SMTP id w8-20020ac857c8000000b0043a47d749a8mr2869509qta.54.1714059051005; Thu, 25 Apr 2024 08:30:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHRipITSXyZr3Vr14MRo1HpcjyjG5oUrzGG+niF3pRMdZ2S/tHF7rJxhDAgZy1rLz4jFJvVmA== X-Received: by 2002:ac8:57c8:0:b0:43a:47d7:49a8 with SMTP id w8-20020ac857c8000000b0043a47d749a8mr2869480qta.54.1714059050628; Thu, 25 Apr 2024 08:30:50 -0700 (PDT) Received: from [192.168.1.130] (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 g6-20020ac870c6000000b004347627f12esm7047747qtp.11.2024.04.25.08.30.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 25 Apr 2024 08:30:49 -0700 (PDT) Message-ID: <32bfcf8c-1b45-444c-8729-e560952fe44b@redhat.com> Date: Thu, 25 Apr 2024 11:30:48 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] c++, v4: Retry the aliasing of base/complete cdtor optimization at import_export_decl time [PR113208] To: Jakub Jelinek , Jonathan Wakely , Jan Hubicka , gcc-patches@gcc.gnu.org, Richard Biener , Patrick Palka References: <5fe9db40-4bff-4be4-a434-6509133f26e3@redhat.com> <5f6569bc-8d94-434c-b66d-137c8e7f5e64@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=-5.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,RCVD_IN_SORBS_WEB,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=no 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 4/25/24 07:22, Jakub Jelinek wrote: > On Thu, Apr 25, 2024 at 02:02:32PM +0200, Jakub Jelinek wrote: >> I've tried the following patch, but unfortunately that lead to large >> number of regressions: >> +FAIL: g++.dg/cpp0x/initlist25.C -std=c++17 (test for excess errors) > > So the reduced testcase for this is > template struct A { > T a1; > U a2; > template > constexpr A(V &&x, W &&y) : a1(x), a2(y) {} > }; > template struct B; > namespace std { > template struct initializer_list { > int *_M_array; > decltype (sizeof 0) _M_len; > }; > } > template struct C { > void foo (std::initializer_list>); > }; > template struct D; > template , typename = B> > struct E { E (const char *); ~E (); }; > int > main () > { > C, E> m; > m.foo ({{"t", "t"}, {"y", "y"}}); > } > Without the patch I've just posted or even with the earlier version > of the patch the > _ZN1AIK1EIc1DIcE1BIcEES5_EC[12]IRA2_KcSB_Lb1EEEOT_OT0_ > ctors were emitted, but with this patch they are unresolved externals. > > The reason is that the code actually uses (calls) the > _ZN1AIK1EIc1DIcE1BIcEES5_EC1IRA2_KcSB_Lb1EEEOT_OT0_ > __ct_comp constructor, that one has TREE_USED, while the > _ZN1AIK1EIc1DIcE1BIcEES5_EC2IRA2_KcSB_Lb1EEEOT_OT0_ > __ct_base constructor is not TREE_USED. > > But the c_parse_final_cleanups loop over > FOR_EACH_VEC_SAFE_ELT (deferred_fns, i, decl) > will ignore the TREE_USED __ct_comp because it is an alias > and so has !DECL_SAVED_TREE: > 5273 if (!DECL_SAVED_TREE (decl)) > 5274 continue; Hmm, maybe maybe_clone_body shouldn't clear DECL_SAVED_TREE for aliases, but rather set it to some stub like void_node? Though with all these changes, it's probably better to go with your first patch for GCC 14 and delay this approach to 15. Your v1 patch is OK for 14. Jason