public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Patrick Palka <ppalka@redhat.com>
To: Jason Merrill <jason@redhat.com>
Cc: Patrick Palka <ppalka@redhat.com>, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] c++: Fix usage of CONSTRUCTOR_PLACEHOLDER_BOUNDARY inside array initializers [90996]
Date: Wed, 8 Apr 2020 10:19:53 -0400 (EDT)	[thread overview]
Message-ID: <alpine.DEB.2.22.413.2004081018130.3094475@idea> (raw)
In-Reply-To: <6ca71ec0-2539-0024-ee17-534ad9fc5dfd@redhat.com>

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:
> > 
> > > 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 inner
> > > > constructor.  In the testcase in the PR, we have as the initializer for
> > > > "S
> > > > c[];"
> > > > the following
> > > > 
> > > >     {{.a=(int &) &_ZGR1c_, .b={*(&<PLACEHOLDER_EXPR struct S>)->a}}}
> > > > 
> > > > where CONSTRUCTOR_PLACEHOLDER_BOUNDARY is set on the second outermost
> > > > 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.
> > > > 
> > > > To fix this, we could perhaps either call replace_placeholders in more
> > > > 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.
> > > 
> > > Interesting.  Yes, that sounds like it should work.
> > > 
> > > > Does this look OK to comit after testing?
> > > 
> > > Yes.
> > > 
> > > Though I'm seeing "after testing" a lot; what testing are you doing before
> > > sending patches?
> > 
> > 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
> > 
> >      make check RUNTESTFLAGS="dg.exp=*.C"
> >      make check RUNTESTFLAGS="old-deja.exp=*.C"
> >      make check RUNTESTFLAGS="conformance.exp=*ranges*"
> > 
> > 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 before
> > sending a patch for review, or would you prefer that I do a full
> > bootstrap/regtest beforehand?
> 
> You don't need to do a full bootstrap and run non-C++ testsuites, but please
> run the full libstdc++ testsuite.
> 
> 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!

> 
> > In any case, I'll make sure to clearly convey the amount of testing that
> > was done and is remaining in future patch submissions.
> 
> Thanks.
> 
> Jason
> 
> 


      reply	other threads:[~2020-04-08 15:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-06 19:07 Patrick Palka
2020-04-06 21:39 ` Jason Merrill
2020-04-06 22:22   ` Patrick Palka
2020-04-08 13:08     ` Jason Merrill
2020-04-08 14:19       ` Patrick Palka [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.22.413.2004081018130.3094475@idea \
    --to=ppalka@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jason@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).