public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] rs6000: Fix up c-c++-common/builtin-classify-type-1.c failure [PR112725]
@ 2023-11-29 18:24 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2023-11-29 18:24 UTC (permalink / raw)
  To: gcc-patches; +Cc: Kewen.Lin

Hi!

The rs6000 backend (and s390 one as well) diagnoses passing vector types
to unprototyped functions, which breaks the builtin-classify-type-1.c test.
The builtin isn't really unprototyped, it is just type-generic and accepting
vector types is just fine there, all it does is categorize the vector type.
The following patch makes sure we don't diagnose it for this builtin.

Preapproved in the PR, bootstrapped/regtested on powerpc64le-linux where it
fixes
-FAIL: c-c++-common/builtin-classify-type-1.c  -Wc++-compat  (test for excess errors)
-UNRESOLVED: c-c++-common/builtin-classify-type-1.c  -Wc++-compat  compilation failed to produce executable
and committed to trunk.

2023-11-29  Jakub Jelinek  <jakub@redhat.com>

	PR target/112725
	* config/rs6000/rs6000.cc (invalid_arg_for_unprototyped_fn): Return
	NULL for __builtin_classify_type calls with vector arguments.

--- gcc/config/rs6000/rs6000.cc.jj	2023-11-17 15:08:20.816961466 +0100
+++ gcc/config/rs6000/rs6000.cc	2023-11-29 09:40:35.782955603 +0100
@@ -24389,7 +24389,8 @@ invalid_arg_for_unprototyped_fn (const_t
 	  && VECTOR_TYPE_P (TREE_TYPE (val))
           && (funcdecl == NULL_TREE
               || (TREE_CODE (funcdecl) == FUNCTION_DECL
-                  && DECL_BUILT_IN_CLASS (funcdecl) != BUILT_IN_MD)))
+                  && DECL_BUILT_IN_CLASS (funcdecl) != BUILT_IN_MD
+                  && !fndecl_built_in_p (funcdecl, BUILT_IN_CLASSIFY_TYPE))))
 	  ? N_("AltiVec argument passed to unprototyped function")
 	  : NULL;
 }

	Jakub


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-11-29 18:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-29 18:24 [committed] rs6000: Fix up c-c++-common/builtin-classify-type-1.c failure [PR112725] Jakub Jelinek

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