s390: Fix builtin-classify-type-1.c on s390 too [PR112725]

Message ID ZWeChQalHyNSI+zw@tucnak
State Unresolved
Headers
Series s390: Fix builtin-classify-type-1.c on s390 too [PR112725] |

Checks

Context Check Description
snail/gcc-patch-check warning Git am fail log

Commit Message

Jakub Jelinek Nov. 29, 2023, 6:27 p.m. UTC
  Hi!

Given that the s390 backend defines pretty much the same target hook
as rs6000, I believe it suffers (at least when using -mvx?) the same
problem as rs6000, though admittedly this is so far completely
untested.

Ok for trunk if it passes bootstrap/regtest there?

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

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


	Jakub
  

Comments

Jakub Jelinek Nov. 30, 2023, 4:34 p.m. UTC | #1
On Wed, Nov 29, 2023 at 07:27:20PM +0100, Jakub Jelinek wrote:
> Given that the s390 backend defines pretty much the same target hook
> as rs6000, I believe it suffers (at least when using -mvx?) the same
> problem as rs6000, though admittedly this is so far completely
> untested.
> 
> Ok for trunk if it passes bootstrap/regtest there?

Now successfully bootstrapped/regtested on s390x-linux and indeed 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
there as well.

> 2023-11-29  Jakub Jelinek  <jakub@redhat.com>
> 
> 	PR target/112725
> 	* config/s390/s390.cc (s390_invalid_arg_for_unprototyped_fn): Return
> 	NULL for __builtin_classify_type calls with vector arguments.
> 
> --- gcc/config/s390/s390.cc.jj	2023-11-27 17:34:25.684287136 +0100
> +++ gcc/config/s390/s390.cc	2023-11-29 09:41:08.569491077 +0100
> @@ -12650,7 +12650,8 @@ s390_invalid_arg_for_unprototyped_fn (co
>  	   && 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_("vector argument passed to unprototyped function")
>  	  : NULL);
>  }

	Jakub
  
Andreas Krebbel Dec. 1, 2023, 6:50 a.m. UTC | #2
On 11/30/23 17:34, Jakub Jelinek wrote:
> On Wed, Nov 29, 2023 at 07:27:20PM +0100, Jakub Jelinek wrote:
>> Given that the s390 backend defines pretty much the same target hook
>> as rs6000, I believe it suffers (at least when using -mvx?) the same
>> problem as rs6000, though admittedly this is so far completely
>> untested.
>>
>> Ok for trunk if it passes bootstrap/regtest there?
> 
> Now successfully bootstrapped/regtested on s390x-linux and indeed 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
> there as well.
> 
>> 2023-11-29  Jakub Jelinek  <jakub@redhat.com>
>>
>> 	PR target/112725
>> 	* config/s390/s390.cc (s390_invalid_arg_for_unprototyped_fn): Return
>> 	NULL for __builtin_classify_type calls with vector arguments.

Ok. Thank you, Jakub!

Andreas
  

Patch

--- gcc/config/s390/s390.cc.jj	2023-11-27 17:34:25.684287136 +0100
+++ gcc/config/s390/s390.cc	2023-11-29 09:41:08.569491077 +0100
@@ -12650,7 +12650,8 @@  s390_invalid_arg_for_unprototyped_fn (co
 	   && 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_("vector argument passed to unprototyped function")
 	  : NULL);
 }