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 87A143858D28 for ; Mon, 17 Jul 2023 16:04:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 87A143858D28 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=1689609887; 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=OfC5DHjjkzVf8twC85DaBTWqwEsbvP3gJg0VaLh3ve4=; b=hRH0PkD8GFnp4Xvw+nZF5oq+cfZ6O8WGVeg7it07VRcigRsq1XZofhJWZmDoZICa6uUGEL sKqXT6ya2uy/oMEWv4dGI1qx9n+Ql+Di7t51ONx8GrO46yEmWWGEbiZaMGco73qD3KEug+ nfhi1IiBj992ZqIXe9/R0oVT9gJ94Po= 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-228-Dfnk1L_mO6q2dlYo6dh8kQ-1; Mon, 17 Jul 2023 12:04:46 -0400 X-MC-Unique: Dfnk1L_mO6q2dlYo6dh8kQ-1 Received: by mail-qt1-f198.google.com with SMTP id d75a77b69052e-403a435e333so36600871cf.1 for ; Mon, 17 Jul 2023 09:04:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689609886; x=1692201886; 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=OfC5DHjjkzVf8twC85DaBTWqwEsbvP3gJg0VaLh3ve4=; b=crcbIMaKHO16z89qD85xZxr+xWdD7bsI0dS+Td5Bh+bFcPkpHSwPxFaps17wHtIyCc NClm7nin0T5OXri2Pf97kpkAvzxjEYvgRaVN7SKqQ5xn2Gb/m9zexLIO5/LJQAhp6K/X Y1kGK2w68Qi95TuwRo2UF+KESM2xk9cc+q5M1BCovMUcnLLkaBft+BtL9mPDK0T6h6zW Iw4kB2rqU4YPYcZmWFNGku+62WzjKrBIpqNfIJXhea8nEnclkhNtHUkf/3oZpAfue5bT jde98fKBgdjABb5QI6X+Krl3dMV6NuTzxOHfJj2ngVnns/nG2wiINTqojNW/dPsPyO3x SlIg== X-Gm-Message-State: ABy/qLYi09fXqoB73jrha8TruklhRil5wOlJPziNHaoFbiFJZbkFI2Yk KnbF87PPYwp77kPVQUt61rEFqIO3Yg7hskX72iqwyiMkE6txIFg2Ee9Jpb69z66AG0jaIg4hVZp kxCpw8sxUGR1fYAV7Mw== X-Received: by 2002:ac8:5a8b:0:b0:402:d15e:2984 with SMTP id c11-20020ac85a8b000000b00402d15e2984mr10891613qtc.32.1689609885828; Mon, 17 Jul 2023 09:04:45 -0700 (PDT) X-Google-Smtp-Source: APBJJlHjDDzu+nywCi3Jjri8fJRegsrBGHIs+uvkGwjkEp5agYcWe5OLR8V91lKDTcffH7vKHvZeDw== X-Received: by 2002:ac8:5a8b:0:b0:402:d15e:2984 with SMTP id c11-20020ac85a8b000000b00402d15e2984mr10891587qtc.32.1689609885491; Mon, 17 Jul 2023 09:04:45 -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 w22-20020ac86b16000000b00403e8422f40sm1675553qts.21.2023.07.17.09.04.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 17 Jul 2023 09:04:44 -0700 (PDT) Message-ID: <3a6c21d8-4191-0008-e816-f6c4d6b00367@redhat.com> Date: Mon, 17 Jul 2023 12:04:43 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v3 1/3] c++: Track lifetimes in constant evaluation [PR70331,PR96630,PR98675] To: Nathaniel Shead Cc: gcc-patches@gcc.gnu.org, Patrick Palka References: <1abfe7ac-1d9e-da4c-3f09-9e446b7ca3ff@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.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,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 7/16/23 09:47, Nathaniel Shead wrote: > On Fri, Jul 14, 2023 at 11:16:58AM -0400, Jason Merrill wrote: >> >> What if, instead of removing the variable from one hash table and adding it >> to another, we change the value to, say, void_node? > > I have another patch I'm working on after this which does seem to > require the overlapping tables to properly catch uses of aggregates > while they are still being constructed (i.e. before their lifetime has > begun), as part of PR c++/109518. In that case the 'values' map contains > the CONSTRUCTOR node for the aggregate, but it also needs to be in > 'outside_lifetime'. I could also explore solving this another way > however if you prefer. I'd think to handle this with a flag on the CONSTRUCTOR to indicate that members with no value are out of lifetime (so, a stronger version of CONSTRUCTOR_NO_CLEARING that just indicates uninitialized). Currently all the TREE_LANG_FLAG_* are occupied on CONSTRUCTOR, but there seem to be plenty of spare bits to add a TREE_LANG_FLAG_7. It might make sense to access those two flags with accessor functions so they stay aligned. > (I also have vague dreams of at some point making this a map to the > location that the object was destroyed for more context in the error > messages, but I'm not yet sure if that's feasible or will actually be > all that helpful so I'm happy to forgo that.) Hmm, that sounds convenient for debugging, but affected cases would also be straightforward to debug by adding a run-time call, so I'm skeptical it would be worth the overhead for successful compiles. Jason