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 1C0F83857B98 for ; Mon, 9 Oct 2023 20:46:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1C0F83857B98 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=1696884410; 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=xw+crlxK3o2y72AZbVtVfsJ/ef7UtyPVcT9z+VoY4kE=; b=Wtbv9dpTFPpdpfiLQT7Q+j6BmXHg+NXFNkE5gsAMsZmtKjpO6SW/gfABaqDvA/bs90bMdO oI617DYjhF4YNf8vd/ZRwZChTljL4Uz2f4RpU8Ki2ujumh+jQUpnl8nnnF+5Ib3mFQr9KX rZ1RBpbVgYTTfCyHB7nTkKGGQG2My4o= Received: from mail-yw1-f200.google.com (mail-yw1-f200.google.com [209.85.128.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-646-sr7CNI34PQq-e_t5tmkurA-1; Mon, 09 Oct 2023 16:46:49 -0400 X-MC-Unique: sr7CNI34PQq-e_t5tmkurA-1 Received: by mail-yw1-f200.google.com with SMTP id 00721157ae682-5a22eb73cb3so88719137b3.3 for ; Mon, 09 Oct 2023 13:46:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696884409; x=1697489209; 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=xw+crlxK3o2y72AZbVtVfsJ/ef7UtyPVcT9z+VoY4kE=; b=Shv4pZoJfM+8q2aO5wfgD/xy2qoxXQM2F/1NY9N8AbA7twstP0Sio5YJyWCGcqpJrY rvffTi2Q5bDPCaDw8Io2FJ4Zl4XSWdjyJyWZqHWaVli1fUK0kRiQACNtdp9sOAnGbgQ6 fxM0GpctvWIcRevBSQxriyXguRDP1ItfGkfzwdRcH0eWrFBJ41uM9wy3Kk52VrkzWHHx x/UfGLwcEyWzo0mXdzyczWGKCGki3uckXDzhvayuljO29wOm5DZg4Vx0+8iVMSJ5goeD /fWkvm8zbbV6a1CVRRpphcHGAIgbH4E9ve71wM+ZurCCuHDoIiNlVgnFTFP4hekKFvmf 888w== X-Gm-Message-State: AOJu0YzJ0Rna+bwIBJe77ZbZ0lZnU+aF9GKB2IKVXLgLfVQPzbW0qVU9 RzPLeCZJEqdRHvd/tId1NLgHGdoKD4abkR3d9EZRxSky5Bm7jx7Hi0fsi1RWQKRuW8FYfR6qKcd dJRozURdiVAkqX0pFXA== X-Received: by 2002:a25:850a:0:b0:d77:e338:1b6b with SMTP id w10-20020a25850a000000b00d77e3381b6bmr13230889ybk.14.1696884408842; Mon, 09 Oct 2023 13:46:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFz2DbThbnpSILm5L3FC9KnhmuI5kDryyX7rhpPs0TCr81KVvlIfD0uGLHshmQoZguSaIoVsA== X-Received: by 2002:a25:850a:0:b0:d77:e338:1b6b with SMTP id w10-20020a25850a000000b00d77e3381b6bmr13230872ybk.14.1696884408444; Mon, 09 Oct 2023 13:46:48 -0700 (PDT) Received: from [172.16.10.171] ([65.196.126.174]) by smtp.gmail.com with ESMTPSA id e14-20020a0ce3ce000000b006577e289d37sm4132700qvl.2.2023.10.09.13.46.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 09 Oct 2023 13:46:47 -0700 (PDT) Message-ID: Date: Mon, 9 Oct 2023 16:46:46 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4] c++: Check for indirect change of active union member in constexpr [PR101631,PR102286] To: Nathaniel Shead Cc: gcc-patches@gcc.gnu.org References: <053faf76-f918-7527-4a41-755a18d0018a@redhat.com> <65235160.170a0220.4cbca.5c7d@mx.google.com> From: Jason Merrill In-Reply-To: <65235160.170a0220.4cbca.5c7d@mx.google.com> 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.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_SHORT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP 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 10/8/23 21:03, Nathaniel Shead wrote: > Ping for https://gcc.gnu.org/pipermail/gcc-patches/2023-September/631203.html > > + && (TREE_CODE (t) == MODIFY_EXPR > + /* Also check if initializations have implicit change of active > + member earlier up the access chain. */ > + || !refs->is_empty()) I'm not sure what the cumulative point of these two tests is. TREE_CODE (t) will be either MODIFY_EXPR or INIT_EXPR, and either should be OK. As I understand it, the problematic case is something like constexpr-union2.C, where we're also looking at a MODIFY_EXPR. So what is this check doing? Incidentally, I think constexpr-union6.C could use a test where we pass &u.s to a function other than construct_at, and then try (and fail) to assign to the b member from that function. Jason