public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] rs6000: Builtins test changes for byte-in-set-2.c
@ 2021-11-18 13:42 Bill Schmidt
  2021-11-18 21:24 ` Segher Boessenkool
  0 siblings, 1 reply; 2+ messages in thread
From: Bill Schmidt @ 2021-11-18 13:42 UTC (permalink / raw)
  To: GCC Patches; +Cc: Segher Boessenkool, David Edelsohn

Hi!  This patch is broken out from the previous patch for builtins test suite
changes.  With the old builtins support, this test case produces:
  warning: implicit declaration of function '__builtin_byte_in_set'; did you mean '__builtin_byte_in_range'?

With the new support, it produces:
  error: '__builtin_scalar_byte_in_set' requires the '-mcpu=power9' option and either the '-m64' or '-mpowerpc64' option
  note: builtin '__builtin_byte_in_set' requires builtin '__builtin_scalar_byte_in_set'

The reason for this is that this builtin wasn't even initialized in the
old support, being defined as a "BU_P9_64BIT_2".  This reflects a
difference in philosophy between the old and new methods.  The old support
often doesn't initialize builtins for which the conditions don't apply
based on compile options, but this can backfire in general when such
constructs as "#pragma target" are used.  The new support initializes all
builtins, and waits until expand time to determine whether or not they are
enabled.  Besides added flexibility, we also get better error messages as
a result.

Tested on powerpc64le-linux-gnu and powerpc-linux-gnu (-m32/-m64) with no
regressions.  Is this okay for trunk?

Thanks!
Bill


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

gcc/testsuite/
	* gcc.target/powerpc/byte-in-set-2.c: Adjust error message.
---
 gcc/testsuite/gcc.target/powerpc/byte-in-set-2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/testsuite/gcc.target/powerpc/byte-in-set-2.c b/gcc/testsuite/gcc.target/powerpc/byte-in-set-2.c
index 44cc7782760..4c676ba356d 100644
--- a/gcc/testsuite/gcc.target/powerpc/byte-in-set-2.c
+++ b/gcc/testsuite/gcc.target/powerpc/byte-in-set-2.c
@@ -10,5 +10,5 @@
 int
 test_byte_in_set (unsigned char b, unsigned long long set_members)
 {
-  return __builtin_byte_in_set (b, set_members); /* { dg-warning "implicit declaration of function" } */
+  return __builtin_byte_in_set (b, set_members); /* { dg-error "'__builtin_scalar_byte_in_set' requires the" } */
 }
-- 
2.27.0



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

* Re: [PATCH] rs6000: Builtins test changes for byte-in-set-2.c
  2021-11-18 13:42 [PATCH] rs6000: Builtins test changes for byte-in-set-2.c Bill Schmidt
@ 2021-11-18 21:24 ` Segher Boessenkool
  0 siblings, 0 replies; 2+ messages in thread
From: Segher Boessenkool @ 2021-11-18 21:24 UTC (permalink / raw)
  To: Bill Schmidt; +Cc: GCC Patches, David Edelsohn

On Thu, Nov 18, 2021 at 07:42:34AM -0600, Bill Schmidt wrote:
> gcc/testsuite/
> 	* gcc.target/powerpc/byte-in-set-2.c: Adjust error message.

"Adjust expected error message" maybe?

Okay for trunk.  Thanks!


Segher

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

end of thread, other threads:[~2021-11-18 21:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-18 13:42 [PATCH] rs6000: Builtins test changes for byte-in-set-2.c Bill Schmidt
2021-11-18 21:24 ` 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).