From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qv1-xf34.google.com (mail-qv1-xf34.google.com [IPv6:2607:f8b0:4864:20::f34]) by sourceware.org (Postfix) with ESMTPS id 223433858D35 for ; Sat, 6 Jan 2024 22:23:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 223433858D35 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=acm.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 223433858D35 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::f34 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704579792; cv=none; b=kDNa6k9vzhwj9WT+veuA+pNWdpNmU/dllRorFTJCdvyzz0N5eWtGjMTTtNOSVv+w33WX7QLa1jnKwAHjMkRM5eZT4NiRvFKBPxXddgceejQmmt2FCnWfDRmiV0y/w2Fh6UX95T072Ci9sbzON3DUtiMJFDFM2f2L/zaFm+6IJ2Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704579792; c=relaxed/simple; bh=1odSk2HYW/5wx7dcgaitiw5bHOJXFgyP1nT1NLlOiKg=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=hkiQbLp0wWiZpyUZ6yc2P2fEtZE1SwWoDKOgkU/Yr2knp8CgfGH2gmj9vwGq9OerslAQ0yDqq2lBPe7WFEuPrgI7xMDe1BNW/Mi5EAk6PRi4n4hRe7BVDOMwXNFjtPKX1/1ZTRVZhHKJBxvcHOOGKyrBsqea5Vhrkw+fWgn82oY= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-qv1-xf34.google.com with SMTP id 6a1803df08f44-680b1335af6so13396926d6.1 for ; Sat, 06 Jan 2024 14:23:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704579789; x=1705184589; darn=gcc.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=M+BquqZKHYuR2Oh+rvN6D/opgRWNNAxzMAvxDFT6hps=; b=AfCLifXCo4bR8p6yMdNz76BkycqGjGLE9K7L/A6rZKt9wXjNPPQXbGifxjGWpEmkRF 4RhGZNMhwskc3uc9oPoJJvKE0e6+Vh0TPwVt56EstedpGuH00qxV8bcs2fMh/q0Sr3si vggCBm4nn1UHWHN0k/Wg8IpJAX8MpDua22GYWiLJgODHIVaqOQR0ivcl9BnHbtn9uDkD ZGiUJOSed+tX39OV50C5hiXzMDtgIh1d92uUoXvVb03fKBIz8h0kMbYa1Mkc9y4epREo SV31WbpvPfpOyQL7+BoSTiq0t5SzXzP77M6Tbe7RrecFXsKVxvxjSs/f0hVdwaP8Nn5Q pPAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704579789; x=1705184589; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=M+BquqZKHYuR2Oh+rvN6D/opgRWNNAxzMAvxDFT6hps=; b=qqZ7a9OqdgUMlnWyv0EfLGYLR7qJ8RbVFn8KL+1Ax+s1Y6DS8TiFZpWFjzmERNi76z U4K2XMVxgz6xTwSTJ05DnQ5xeiNhEu6HjmnhHlQpzMKLVUT9dH2ZLtizh0beybjyZUtO HMCR+3qBMu+DOHAWzvCNmW0vDQ3GNu+HeDPMWrAfv5M1jaAxHouLxZrVNZCk+znECfnz vhYlaWq/xfzpfcx4Hjl0ExuCMACKNWg17XEv+n1VpyLgT675yCGotnMB/ny4PxnzFvrB +UuwIuiv96F82ZYQqb6RAACrvLBKLdkxBdaD0GIDPNAXJmOzLAjm5hVjodSGZ0Ag+pb8 qXBw== X-Gm-Message-State: AOJu0YwalA0N+mhy6mUxllIvOMCVtR4cjcTLMI8WR4xk2nbfnypxUKJY d8x/fVg1IAKAF+nnLcWlx9A= X-Google-Smtp-Source: AGHT+IHouDa7z9nOeh8TkOtJB8tYvzzZv+IlyG0bRARM4BOtypaii/EdSgw026ee7PwcN/XR37mrwg== X-Received: by 2002:a05:6214:29c2:b0:680:f9ca:fa4e with SMTP id gh2-20020a05621429c200b00680f9cafa4emr1530915qvb.9.1704579789439; Sat, 06 Jan 2024 14:23:09 -0800 (PST) Received: from ?IPV6:2600:4040:5b0e:b500:15a3:ac43:deab:f0a7? ([2600:4040:5b0e:b500:15a3:ac43:deab:f0a7]) by smtp.googlemail.com with ESMTPSA id w13-20020a056214012d00b0067f678747ffsm1656645qvs.50.2024.01.06.14.23.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 06 Jan 2024 14:23:09 -0800 (PST) Sender: Nathan Sidwell Message-ID: <1739da56-c77d-4c97-a324-366e64a73820@acm.org> Date: Sat, 6 Jan 2024 17:23:07 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] c++/modules: seed namespaces for bindings [PR106363] Content-Language: en-US To: Nathaniel Shead , gcc-patches@gcc.gnu.org Cc: Jason Merrill References: <6550318c.170a0220.caf0c.3fe5@mx.google.com> From: Nathan Sidwell In-Reply-To: <6550318c.170a0220.caf0c.3fe5@mx.google.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3037.6 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,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE,URIBL_BLACK 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: Ok, I think I js=ust thought this unnecessary. On 11/11/23 20:59, Nathaniel Shead wrote: > Bootstrapped and regtested on x86_64-pc-linux-gnu. I don't have write > access. > > -- >8 -- > > Currently the first depset for an EK_BINDING is not seeded. This breaks > the attached testcase as then the namespace is not considered referenced > yet during streaming, but we've already finished importing. > > There doesn't seem to be any particular reason I could find for skipping > the first depset for bindings, and removing the condition doesn't appear > to cause any test failures, so this patch removes that check. > > PR c++/106363 > > gcc/cp/ChangeLog: > > * module.cc (module_state::write_cluster): Don't skip first > depset for bindings. > > gcc/testsuite/ChangeLog: > > * g++.dg/modules/pr106363_a.C: New test. > * g++.dg/modules/pr106363_b.C: New test. > > Signed-off-by: Nathaniel Shead > --- > gcc/cp/module.cc | 4 +--- > gcc/testsuite/g++.dg/modules/pr106363_a.C | 9 +++++++++ > gcc/testsuite/g++.dg/modules/pr106363_b.C | 10 ++++++++++ > 3 files changed, 20 insertions(+), 3 deletions(-) > create mode 100644 gcc/testsuite/g++.dg/modules/pr106363_a.C > create mode 100644 gcc/testsuite/g++.dg/modules/pr106363_b.C > > diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc > index c1c8c226bc1..411a3b9411c 100644 > --- a/gcc/cp/module.cc > +++ b/gcc/cp/module.cc > @@ -14741,9 +14741,7 @@ module_state::write_cluster (elf_out *to, depset *scc[], unsigned size, > for (unsigned ix = 0; ix != size; ix++) > { > depset *b = scc[ix]; > - for (unsigned jx = (b->get_entity_kind () == depset::EK_BINDING > - || b->is_special ()) ? 1 : 0; > - jx != b->deps.length (); jx++) > + for (unsigned jx = b->is_special (); jx != b->deps.length (); jx++) > { > depset *dep = b->deps[jx]; > > diff --git a/gcc/testsuite/g++.dg/modules/pr106363_a.C b/gcc/testsuite/g++.dg/modules/pr106363_a.C > new file mode 100644 > index 00000000000..c18d2eef1c8 > --- /dev/null > +++ b/gcc/testsuite/g++.dg/modules/pr106363_a.C > @@ -0,0 +1,9 @@ > +// PR c++/106363 > +// { dg-additional-options "-fmodules-ts" } > +// { dg-module-cmi pr106363.a } > + > +export module pr106363.a; > + > +namespace ns { > + export int x; > +} > diff --git a/gcc/testsuite/g++.dg/modules/pr106363_b.C b/gcc/testsuite/g++.dg/modules/pr106363_b.C > new file mode 100644 > index 00000000000..0508c0d6193 > --- /dev/null > +++ b/gcc/testsuite/g++.dg/modules/pr106363_b.C > @@ -0,0 +1,10 @@ > +// PR c++/106363 > +// { dg-additional-options "-fmodules-ts" } > +// { dg-module-cmi pr106363.b } > + > +export module pr106363.b; > +import pr106363.a; > + > +namespace ns { > + export using ns::x; > +} -- Nathan Sidwell