public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: Bill Schmidt <wschmidt@linux.ibm.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>,
	David Edelsohn <dje.gcc@gmail.com>
Subject: Re: [PATCH] rs6000: Builtins test changes for BFP scalar tests
Date: Wed, 1 Dec 2021 15:16:25 -0600	[thread overview]
Message-ID: <20211201211625.GF614@gate.crashing.org> (raw)
In-Reply-To: <2e1fd69f-4d02-23db-8c0a-cf55461ddbd9@linux.ibm.com>

On Thu, Nov 18, 2021 at 03:59:41PM -0600, Bill Schmidt wrote:
> On 11/18/21 3:32 PM, Segher Boessenkool wrote:
> > On Thu, Nov 18, 2021 at 03:30:48PM -0600, Bill Schmidt wrote:
> >> On 11/18/21 3:16 PM, Segher Boessenkool wrote:
> >>> On Wed, Nov 17, 2021 at 05:06:05PM -0600, Bill Schmidt wrote:
> >>>>> I don't like that at all.  The user didn't write the _vsx thing, and it
> >>>>> isn't documented either (neither is the _vec one, but that is a separate
> >>>>> issue, specific to this builtin).
> >>>> I feel like I haven't explained this well.  This kind of thing has been in
> >>>> existence forever even in the old builtins code.  The combination of the
> >>>> error showing the internal builtin name, and the note tying the overload
> >>>> name to the internal builtin name, has been there all along.  The name of
> >>>> the internal builtin is pretty meaningless.  The only thing that's interesting
> >>>> in this case is that we previously didn't get this *for this specific case*
> >>>> because the old code went to a generic fallback.  But in many other cases
> >>>> you get exactly this same kind of error message for the old code.
> >>> Yes.  And it still is a regression (in *this* case).
> >> Sorry, I don't understand.  Why specifically is this a regression?
> > It is wrong now, in ways that it wasn't wrong before.  That is the
> > definition of regression!
> 
> I'm sorry, I disagree.  With clarification of the note, I don't see how
> this can be considered a regression.  It is providing information in a
> different way, but it is still clear that the user has misused the builtin
> in the context, and, unlike before, it now tells them *what* is wrong with
> the options that were used (not just "unavailable in this configuration").
> The fact that an internal builtin name is *also* disclosed as part of
> this does not make it wrong.

It is claiming something is wrong with something the user didn't write.
The blow is softened a lot by the inform(), but it still is a
regression.  But you said you'll look into it, and it will be okay for
now, it isn't like this is super important.  Just an ugly wart :-)

> The way that overloads work, we can only tell whether a builtin is
> enabled with the current set of options by looking at the true builtin
> that the overload maps to.  The enablement checking code doesn't have
> any knowledge that an overloaded function maps to it.  So that error
> message is produced without knowledge of the overloading.  The note
> diagnostic is added by the overload processing code that *is* aware
> that the mapping exists.

Yeah, but you can keep track of what the original name was, somewhere.
Hopefully, anyway :-)

> The enablement checking code (rs6000_invalid_builtin in the old code,
> rs6000_invalid_new_builtin in the new code) is called from multiple
> places, and not always in an overload context, so we can't assume
> this is the case.  Not all builtins are mapped to by overloads, but
> they still need enablement checking.

A direct call would not get the "this comes from <this> overload" field
set, so that is easy to see in the error message code.

> Would it be possible to change things so that we pass in the overload
> name to be used in the error message when appropriate?  Yes.  But
> this would have a much larger impact on the test suite than the
> current method, because all error tests for overloads would now
> have to change.  That is, there are many existing tests that are
> already "wrong" in the sense that they report the internal builtin
> name.
> 
> I suggest that we add that to the list of future cleanups due to
> the size of the impact.  I agree that it has never been ideal to
> mention the internal builtin name on these messages.  It's just
> not unique to the changes I've made here; it's a pre-existing
> condition that needs work to cleanse it everywhere.
> 
> Can we move forward this way?

We can yes :-)  And thanks in advance!  It would be nice if we could
see this in GCC 12 still.  It is fine for stage 4 still, if it is error
message only (and a lot of testsuite :-) )


Segher

  reply	other threads:[~2021-12-01 21:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-17 20:58 Bill Schmidt
2021-11-17 21:32 ` Segher Boessenkool
2021-11-17 23:06   ` Bill Schmidt
2021-11-18 13:32     ` Bill Schmidt
2021-11-18 21:18       ` Segher Boessenkool
2021-11-18 21:16     ` Segher Boessenkool
2021-11-18 21:30       ` Bill Schmidt
2021-11-18 21:32         ` Segher Boessenkool
2021-11-18 21:59           ` Bill Schmidt
2021-12-01 21:16             ` Segher Boessenkool [this message]
2021-12-01 16:31 ` [PATCH, PING] " Bill Schmidt
2021-12-01 21:29 ` [PATCH] " Segher Boessenkool

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=20211201211625.GF614@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=wschmidt@linux.ibm.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).