From 259bb7a45a26b76cbde2131a62926d4419c1cc1b Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 29 Nov 2023 19:19:07 +0100 Subject: [PATCH] rs6000: Fix up c-c++-common/builtin-classify-type-1.c failure [PR112725] 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. 2023-11-29 Jakub Jelinek 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc index 3dfd79c4c43..cee22c359f3 100644 --- a/gcc/config/rs6000/rs6000.cc +++ b/gcc/config/rs6000/rs6000.cc @@ -24389,7 +24389,8 @@ invalid_arg_for_unprototyped_fn (const_tree typelist, const_tree funcdecl, const && 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; }