[GCC 10 PATCH] aarch64: Treat GNU and Advanced SIMD vectors as distinct [PR95726]

Jakub Jelinek jakub@redhat.com
Wed Jul 8 14:20:47 GMT 2020


On Wed, Jul 08, 2020 at 03:10:14PM +0100, Richard Sandiford wrote:
> gcc/
> 	PR target/95726
> 	* config/aarch64/aarch64.c (aarch64_attribute_table): Add
> 	"Advanced SIMD type".
> 	* config/aarch64/aarch64-builtins.c: Include stringpool.h and
> 	attribs.h.
> 	(aarch64_init_simd_builtin_types): Add an "Advanced SIMD type"
> 	attribute to each Advanced SIMD type.
> 
> gcc/cp/
> 	PR target/95726
> 	* typeck.c (structural_comptypes): When comparing template
> 	specializations, differentiate between vectors that have and
> 	do not have an "Advanced SIMD type" attribute.
> 
> gcc/testsuite/
> 	PR target/95726
> 	* g++.target/aarch64/pr95726.C: New test.
> --- a/gcc/cp/typeck.c
> +++ b/gcc/cp/typeck.c
> @@ -1429,6 +1429,15 @@ structural_comptypes (tree t1, tree t2, int strict)
>  	  || maybe_ne (TYPE_VECTOR_SUBPARTS (t1), TYPE_VECTOR_SUBPARTS (t2))
>  	  || !same_type_p (TREE_TYPE (t1), TREE_TYPE (t2)))
>  	return false;

I'd at least add an explaining comment that it is a hack for GCC 8-10 only,
for aarch64 and arm targets, why, reference to the PR and that it is solved
differently for GCC 11+.

> +      if (comparing_specializations)
> +	{
> +	  bool asimd1 = lookup_attribute ("Advanced SIMD type",
> +					  TYPE_ATTRIBUTES (t1));
> +	  bool asimd2 = lookup_attribute ("Advanced SIMD type",
> +					  TYPE_ATTRIBUTES (t2));
> +	  if (asimd1 != asimd2)
> +	    return false;
> +	}

Otherwise LGTM for release branches if it is acceptable that way to Jason.

Just note, Richi announced 10.2 RC will be June 15th, so would be nice to
have it in by then.

	Jakub



More information about the Gcc-patches mailing list