public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Bill Schmidt <wschmidt@linux.ibm.com>
To: GCC Patches <gcc-patches@gcc.gnu.org>
Cc: Segher Boessenkool <segher@kernel.crashing.org>,
	David Edelsohn <dje.gcc@gmail.com>
Subject: [PATCH] rs6000: Clarify overloaded builtin diagnostic
Date: Tue, 23 Nov 2021 12:40:45 -0600	[thread overview]
Message-ID: <0fe6d48a-3834-c962-40c1-48bd507c7cea@linux.ibm.com> (raw)

Hi!

When a built-in function required by an overloaded function name is not
currently enabled, the diagnostic message is not as clear as it should be.
Saying that one built-in "requires" another is somewhat misleading.  It	is
better to explicitly state that the overloaded builtin is implemented by the
missing builtin, so the user knows that the previous error message for the
implementing builtin is because of the overload relationship.

This patch adjusts the informational diagnostic for both the original support
and the new builtin support.  This doesn't affect the test suite, since we
don't test for "note" diagnostics anywhere.

Bootstrapped and tested on powerpc64le-linux-gnu with no regressions.  Is
this okay for trunk?

Thanks!
Bill


2021-11-23  Bill Schmidt  <wschmidt@linux.ibm.com>

gcc/
	* config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin):
	Clarify diagnostic.
	(altivec_resolve_new_overloaded_builtin): Likewise.
---
 gcc/config/rs6000/rs6000-c.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gcc/config/rs6000/rs6000-c.c b/gcc/config/rs6000/rs6000-c.c
index d08bdfec3ae..5eeac9d4c06 100644
--- a/gcc/config/rs6000/rs6000-c.c
+++ b/gcc/config/rs6000/rs6000-c.c
@@ -1946,7 +1946,8 @@ altivec_resolve_overloaded_builtin (location_t loc, tree fndecl,
 	       non-overloaded function has already been issued.  Add
 	       clarification of the previous message.  */
 	    rich_location richloc (line_table, input_location);
-	    inform (&richloc, "builtin %qs requires builtin %qs",
+	    inform (&richloc,
+		    "overloaded builtin %qs is implemented by builtin %qs",
 		    name, internal_name);
 	  }
 	else
@@ -2992,7 +2993,8 @@ altivec_resolve_new_overloaded_builtin (location_t loc, tree fndecl,
 	       non-overloaded function has already been issued.  Add
 	       clarification of the previous message.  */
 	    rich_location richloc (line_table, input_location);
-	    inform (&richloc, "builtin %qs requires builtin %qs",
+	    inform (&richloc,
+		    "overloaded builtin %qs is implemented by builtin %qs",
 		    name, internal_name);
 	  }
 	else
-- 
2.27.0



             reply	other threads:[~2021-11-23 18:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-23 18:40 Bill Schmidt [this message]
2021-11-26 19:54 ` 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=0fe6d48a-3834-c962-40c1-48bd507c7cea@linux.ibm.com \
    --to=wschmidt@linux.ibm.com \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=segher@kernel.crashing.org \
    /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).