From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) by sourceware.org (Postfix) with ESMTPS id 0CEF03858D38 for ; Tue, 20 Sep 2022 14:14:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0CEF03858D38 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=acm.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-qk1-x72b.google.com with SMTP id h28so1723593qka.0 for ; Tue, 20 Sep 2022 07:14:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date; bh=8tOQFhmWV0/+bI/bDnhGRyJUle3vVO7ZOSgzxCQF8ek=; b=R5onHziOgo3/X+WiZSYnULQMn+qnyLECg56MXUGZJwwI+suHd5uj+gph2P2/C6EKur zdUQojsgb3dFfzA6ANHLU5UMgynTRj5UoAlpCvxdDaxs9yPlzUAj6RS3MU5fSlcDzFSL OW+HQnFlG1xSnWB6lk8PUfCnstYvFZId6xxEvEpR0MmlI+xm5xsuG+er3XkYndt9aBbG CDCh1M24szAMUC4TJFtV9XMg6DypdggD+lEv5K7hJd31tkFoVpV3Qt/qowIg9heoEsrZ zmtW79YyK9WND6RXvfrfu2ST3DEr4UgIJNMmnmqX0Eg9A0m4P2qIC+p6HdYlfAlnUXCB dJ+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date; bh=8tOQFhmWV0/+bI/bDnhGRyJUle3vVO7ZOSgzxCQF8ek=; b=gXHdUlJoj12cRICjzk9ea8mYXGUEWkov55xgnWnSLAJGL1WNxz1wa6Xqc4ntlS7W28 VN2/xmlIPkXewXr9nY/pZ3cVYf5s3EP0luK2fjaBsCuFn274VNTUvpPGhO+c0Ymq4IYc OdFVoeax6CZ6eDiu3VZGPSjXt3zVYl5pdE994ZGt1Sxrob9PCrkaacfClEl5n12V9LUb 9TfeWI41XOW1Te3pd3yFNcHyomtYR5KAEIojMLCsmGcfeKnSFx2RScdt3ZjK6Viqw2hY 3pR8bA1351YLpmwpDbvLH1Cq9xv9xEuxCdrsDNYUjihF+ygZzPzuWGGutj+u8XlirkA5 zDYg== X-Gm-Message-State: ACrzQf1T+yIcSzN3a4rqEnSMYdQAvmYMpVwmwJofpJT5WF9eR6w0eea5 ukaH9ecYraNdamugKikVHFM= X-Google-Smtp-Source: AMsMyM53jHE+VtkwGnuYG2M26csHO9md7bysUkDgrQoO2HSnO+VPznkPow15u7VWvdn0Jv4cZw2NlQ== X-Received: by 2002:a05:620a:44cb:b0:6ce:b918:2ed3 with SMTP id y11-20020a05620a44cb00b006ceb9182ed3mr17197034qkp.117.1663683258141; Tue, 20 Sep 2022 07:14:18 -0700 (PDT) Received: from ?IPV6:2620:10d:c0a3:1407:577f:1cb6:f1c1:e86f? ([2620:10d:c091:500::4:9b1b]) by smtp.googlemail.com with ESMTPSA id q11-20020a05620a0d8b00b006aedb35d8a1sm197524qkl.74.2022.09.20.07.14.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 20 Sep 2022 07:14:17 -0700 (PDT) Sender: Nathan Sidwell Message-ID: <19c448fb-2bcf-f763-0a98-98c7d91e62d9@acm.org> Date: Tue, 20 Sep 2022 10:14:16 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.1 Subject: Re: [PATCH] c++: stream PACK_EXPANSION_EXTRA_ARGS [PR106761] To: Patrick Palka Cc: gcc-patches@gcc.gnu.org, jason@redhat.com References: <20220919135229.86545-1-ppalka@redhat.com> <5e4ec1f5-a546-6830-ea97-4b3d876c002e@idea> Content-Language: en-US From: Nathan Sidwell In-Reply-To: <5e4ec1f5-a546-6830-ea97-4b3d876c002e@idea> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3040.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,GIT_PATCH_0,HEADER_FROM_DIFFERENT_DOMAINS,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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 9/20/22 10:08, Patrick Palka wrote: > On Tue, 20 Sep 2022, Nathan Sidwell wrote: > >> On 9/19/22 09:52, Patrick Palka wrote: >>> It looks like some xtreme-header-* tests are failing after the libstdc++ >>> change r13-2158-g02f6b405f0e9dc ultimately because we're neglecting >>> to stream PACK_EXPANSION_EXTRA_ARGS, which leads to false equivalences >>> of different partial instantiations of _TupleConstraints::__constructible. >>> >>> Tested on x86_64-pc-linux-gnu, does this look OK for trunk? >>> >>> PR c++/106761 >>> >>> gcc/cp/ChangeLog: >>> >>> * module.cc (trees_out::type_node) : >>> Stream PACK_EXPANSION_EXTRA_ARGS. >>> (trees_in::tree_node) : Likewise. >> >> >> Looks good, I wonder why I missed that. (I guess extracting a testcase out of >> the headers was too tricky?) > > Many thanks. I managed to produce a small testcase which mirrors the > format of the xtreme-header-2* testcase. Does the following look OK? yup, thanks for extracting that! nathan > > -- >8 -- > > PR c++/106761 > > gcc/cp/ChangeLog: > > * module.cc (trees_out::type_node) : > Stream PACK_EXPANSION_EXTRA_ARGS. > (trees_in::tree_node) : Likewise. > > gcc/testsuite/ChangeLog: > > * g++.dg/modules/pr106761.h: New test. > * g++.dg/modules/pr106761_a.H: New test. > * g++.dg/modules/pr106761_b.C: New test. > --- > gcc/cp/module.cc | 3 +++ > gcc/testsuite/g++.dg/modules/pr106761.h | 22 ++++++++++++++++++++++ > gcc/testsuite/g++.dg/modules/pr106761_a.H | 5 +++++ > gcc/testsuite/g++.dg/modules/pr106761_b.C | 7 +++++++ > 4 files changed, 37 insertions(+) > create mode 100644 gcc/testsuite/g++.dg/modules/pr106761.h > create mode 100644 gcc/testsuite/g++.dg/modules/pr106761_a.H > create mode 100644 gcc/testsuite/g++.dg/modules/pr106761_b.C > > diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc > index 1a1ff5be574..9a9ef4e3332 100644 > --- a/gcc/cp/module.cc > +++ b/gcc/cp/module.cc > @@ -8922,6 +8922,7 @@ trees_out::type_node (tree type) > if (streaming_p ()) > u (PACK_EXPANSION_LOCAL_P (type)); > tree_node (PACK_EXPANSION_PARAMETER_PACKS (type)); > + tree_node (PACK_EXPANSION_EXTRA_ARGS (type)); > break; > > case TYPENAME_TYPE: > @@ -9455,12 +9456,14 @@ trees_in::tree_node (bool is_use) > { > bool local = u (); > tree param_packs = tree_node (); > + tree extra_args = tree_node (); > if (!get_overrun ()) > { > tree expn = cxx_make_type (TYPE_PACK_EXPANSION); > SET_TYPE_STRUCTURAL_EQUALITY (expn); > PACK_EXPANSION_PATTERN (expn) = res; > PACK_EXPANSION_PARAMETER_PACKS (expn) = param_packs; > + PACK_EXPANSION_EXTRA_ARGS (expn) = extra_args; > PACK_EXPANSION_LOCAL_P (expn) = local; > res = expn; > } > diff --git a/gcc/testsuite/g++.dg/modules/pr106761.h b/gcc/testsuite/g++.dg/modules/pr106761.h > new file mode 100644 > index 00000000000..9f22a22a45d > --- /dev/null > +++ b/gcc/testsuite/g++.dg/modules/pr106761.h > @@ -0,0 +1,22 @@ > +// PR c++/106761 > + > +template > +struct __and_; > + > +template > +struct is_convertible; > + > +template > +struct _TupleConstraints { > + template > + using __constructible = __and_...>; > +}; > + > +template > +struct tuple { > + template > + using __constructible > + = typename _TupleConstraints::template __constructible; > +}; > + > +tuple t; > diff --git a/gcc/testsuite/g++.dg/modules/pr106761_a.H b/gcc/testsuite/g++.dg/modules/pr106761_a.H > new file mode 100644 > index 00000000000..8ad116412af > --- /dev/null > +++ b/gcc/testsuite/g++.dg/modules/pr106761_a.H > @@ -0,0 +1,5 @@ > +// PR c++/106761 > +// { dg-additional-options -fmodule-header } > + > +// { dg-module-cmi {} } > +#include "pr106761.h" > diff --git a/gcc/testsuite/g++.dg/modules/pr106761_b.C b/gcc/testsuite/g++.dg/modules/pr106761_b.C > new file mode 100644 > index 00000000000..336cb12757e > --- /dev/null > +++ b/gcc/testsuite/g++.dg/modules/pr106761_b.C > @@ -0,0 +1,7 @@ > +// PR c++/106761 > +// { dg-additional-options -fmodules-ts } > + > +#include "pr106761.h" > +import "pr106761_a.H"; > + > +tuple u = t; -- Nathan Sidwell