From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by sourceware.org (Postfix) with ESMTP id 683D73945C16 for ; Wed, 8 Apr 2020 15:13:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 683D73945C16 Received: from mail-io1-f71.google.com (mail-io1-f71.google.com [209.85.166.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-205-VILFfqpNMwKucfAhGlfK3g-1; Wed, 08 Apr 2020 11:13:43 -0400 X-MC-Unique: VILFfqpNMwKucfAhGlfK3g-1 Received: by mail-io1-f71.google.com with SMTP id s1so191746iow.18 for ; Wed, 08 Apr 2020 08:13:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=JbSJtiTlGo3e6af+6BBHNK7b3F9XClLj/CMHxnSM9rg=; b=GsqJl3wD4BDHqaQezNK46OSqrnesaNKFlYKMiMPmto62WmPPShM347y1oVd7xl6rK2 QpqK/wlz263SGE9ZhhRZMxBbILHc6vW4Kh7052bmr4CifH6dkCCe9/S+qGTJJdM63gGN tnrorKQ728raYfnXTGdAwZ1L9jiJLrlVxB1AJUpnM0jstmiJJu1yG2UYSzWzlcz5HK+9 j3gFu9YEMOev/zrtKcHDNsAmUr3Pg4tfD///F6jz3jTXS1BcA1NRyYx9w58TrOfTAwAg mlUDk/uI6UgN/+ixl3AZ2k5obylaXWUcRAT0tWhFyifhaUYVZjullnS25YpBOPviKQkX Zo2Q== X-Gm-Message-State: AGi0PuZd/D8cDI5Bc9eja75tIx3TBye4Ai0lFdVqfTjZIsT+KZGl3MIQ 8YC5sTain8HswRHS1TTFcn+CJYqF0gZIqDpPkwMBHRGauHHibOMZZiBydLVIq43YffFSu9qed22 l+6I4kl/vkzyEyltg0g== X-Received: by 2002:a02:a907:: with SMTP id n7mr514307jam.67.1586358820844; Wed, 08 Apr 2020 08:13:40 -0700 (PDT) X-Google-Smtp-Source: APiQypKwR/8TXzDLcoZAmyH//66tVcHDFOP34oVOaaVGq5AU/AnAB5HIdfCrMU5XvmByr7W3ngUywA== X-Received: by 2002:a37:a5c2:: with SMTP id o185mr7611937qke.219.1586355594813; Wed, 08 Apr 2020 07:19:54 -0700 (PDT) Received: from [192.168.1.130] (ool-457d493a.dyn.optonline.net. [69.125.73.58]) by smtp.gmail.com with ESMTPSA id p186sm13316235qkb.71.2020.04.08.07.19.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Apr 2020 07:19:54 -0700 (PDT) From: Patrick Palka X-Google-Original-From: Patrick Palka Date: Wed, 8 Apr 2020 10:19:53 -0400 (EDT) To: Jason Merrill cc: Patrick Palka , gcc-patches@gcc.gnu.org Subject: Re: [PATCH] c++: Fix usage of CONSTRUCTOR_PLACEHOLDER_BOUNDARY inside array initializers [90996] In-Reply-To: <6ca71ec0-2539-0024-ee17-534ad9fc5dfd@redhat.com> Message-ID: References: <20200406190756.1798784-1-ppalka@redhat.com> <6ca71ec0-2539-0024-ee17-534ad9fc5dfd@redhat.com> User-Agent: Alpine 2.22 (DEB 413 2020-03-19) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Apr 2020 15:13:47 -0000 On Wed, 8 Apr 2020, Jason Merrill wrote: > On 4/6/20 6:22 PM, Patrick Palka wrote: > > On Mon, 6 Apr 2020, Jason Merrill wrote: > >=20 > > > On 4/6/20 3:07 PM, Patrick Palka wrote: > > > > This PR reports that since the introduction of the > > > > CONSTRUCTOR_PLACEHOLDER_BOUNDARY flag, we are sometimes failing to > > > > resolve > > > > PLACEHOLDER_EXPRs inside array initializers that refer to some inne= r > > > > constructor. In the testcase in the PR, we have as the initializer= for > > > > "S > > > > c[];" > > > > the following > > > >=20 > > > > {{.a=3D(int &) &_ZGR1c_, .b=3D{*(&)-= >a}}} > > > >=20 > > > > where CONSTRUCTOR_PLACEHOLDER_BOUNDARY is set on the second outermo= st > > > > constructor. However, we pass the whole initializer to > > > > replace_placeholders > > > > in > > > > store_init_value, and so due to the flag being set on the second > > > > outermost > > > > ctor > > > > it avoids recursing into the innermost constructor and we fail to > > > > resolve > > > > the > > > > PLACEHOLDER_EXPR within. > > > >=20 > > > > To fix this, we could perhaps either call replace_placeholders in m= ore > > > > places, > > > > or we could change where we set CONSTRUCTOR_PLACEHOLDER_BOUNDARY. = This > > > > patch > > > > takes the latter approach -- when building up an array initializer,= it > > > > bubbles > > > > any CONSTRUCTOR_PLACEHOLDER_BOUNDARY flag set on the element > > > > initializers up > > > > to > > > > the array initializer. Doing so shouldn't create any new > > > > PLACEHOLDER_EXPR > > > > resolution ambiguities because we don't deal with PLACEHOLDER_EXPRs= of > > > > array > > > > type in the frontend, as far as I can tell. > > >=20 > > > Interesting. Yes, that sounds like it should work. > > >=20 > > > > Does this look OK to comit after testing? > > >=20 > > > Yes. > > >=20 > > > Though I'm seeing "after testing" a lot; what testing are you doing b= efore > > > sending patches? > >=20 > > Sorry for the sloppiness -- I should be writing "after a full > > bootstrap/regtest" instead of "after testing" because I do indeed do > > some testing before sending a patch. In particular, I usually run and > > inspect the outputs of > >=20 > > make check RUNTESTFLAGS=3D"dg.exp=3D*.C" > > make check RUNTESTFLAGS=3D"old-deja.exp=3D*.C" > > make check RUNTESTFLAGS=3D"conformance.exp=3D*ranges*" > >=20 > > in a build tree that is configured with --disable-bootstrap, as a quick > > smoke test for the patch. Is this a sufficient amount of testing befor= e > > sending a patch for review, or would you prefer that I do a full > > bootstrap/regtest beforehand? >=20 > You don't need to do a full bootstrap and run non-C++ testsuites, but ple= ase > run the full libstdc++ testsuite. >=20 > Is there a reason you aren't using 'make check-c++'? No good reason, I didn't know about "make check-c++" :) Good to know, thanks! >=20 > > In any case, I'll make sure to clearly convey the amount of testing tha= t > > was done and is remaining in future patch submissions. >=20 > Thanks. >=20 > Jason >=20 >=20