public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] rs6000: Clarify overloaded builtin diagnostic
@ 2021-11-23 18:40 Bill Schmidt
  2021-11-26 19:54 ` Segher Boessenkool
  0 siblings, 1 reply; 2+ messages in thread
From: Bill Schmidt @ 2021-11-23 18:40 UTC (permalink / raw)
  To: GCC Patches; +Cc: Segher Boessenkool, David Edelsohn

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



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] rs6000: Clarify overloaded builtin diagnostic
  2021-11-23 18:40 [PATCH] rs6000: Clarify overloaded builtin diagnostic Bill Schmidt
@ 2021-11-26 19:54 ` Segher Boessenkool
  0 siblings, 0 replies; 2+ messages in thread
From: Segher Boessenkool @ 2021-11-26 19:54 UTC (permalink / raw)
  To: Bill Schmidt; +Cc: GCC Patches, David Edelsohn

Hi!

On Tue, Nov 23, 2021 at 12:40:45PM -0600, Bill Schmidt wrote:
> 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.

Thanks.  And saying "is implemented by __builtin_xyz" where that builtin
has not the most obvious name nor is even documented is a lot better
than saying that builtin is required :-)

> gcc/
> 	* config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin):
> 	Clarify diagnostic.
> 	(altivec_resolve_new_overloaded_builtin): Likewise.

Please don't break changelog lines early, especially not after a colon.
It looks like something might be missing (and interrupts the flow of
reading anyway).

Okay for trunk.  Thanks!


Segher

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-26 19:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-23 18:40 [PATCH] rs6000: Clarify overloaded builtin diagnostic Bill Schmidt
2021-11-26 19:54 ` Segher Boessenkool

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).