aarch64: Fix up aarch64_simd_clone_compute_vecsize_and_simdlen [PR99542]
authorJakub Jelinek <jakub@redhat.com>
Tue, 16 Mar 2021 09:34:44 +0000 (10:34 +0100)
committerJakub Jelinek <jakub@redhat.com>
Tue, 16 Mar 2021 09:34:44 +0000 (10:34 +0100)
commitfcefc59befd396267b824c170b6a37acaf10874e
treea0f659205cbc69589a6d7f70a96c6752f7e00ec0
parent1973beaf92c629f26df98eff33ab1bce7f3ea4ef
aarch64: Fix up aarch64_simd_clone_compute_vecsize_and_simdlen [PR99542]

As the patch shows, there are several bugs in
aarch64_simd_clone_compute_vecsize_and_simdlen.
One is that unlike for function declarations that aren't definitions
it completely ignores argument types.  Such decls don't have DECL_ARGUMENTS,
but we can walk TYPE_ARG_TYPES instead, like the i386 backend does or like
the simd cloning code in the middle end does too.

Another problem is that it checks types of uniform arguments.  That is
unnecessary, uniform arguments are passed the way it normally is, it is
a scalar argument rather than vector, so there is no reason not to support
uniform argument of different size, or long double, structure etc.

2021-03-16  Jakub Jelinek  <jakub@redhat.com>

PR target/99542
* config/aarch64/aarch64.c
(aarch64_simd_clone_compute_vecsize_and_simdlen): If not a function
definition, walk TYPE_ARG_TYPES list if non-NULL for argument types
instead of DECL_ARGUMENTS.  Ignore types for uniform arguments.

* gcc.dg/gomp/pr99542.c: New test.
* gcc.dg/gomp/pr59669-2.c (bar): Don't expect a warning on aarch64.
* gcc.dg/gomp/simd-clones-2.c (setArray): Likewise.
* g++.dg/vect/simd-clone-7.cc (bar): Likewise.
* g++.dg/gomp/declare-simd-1.C (f37): Expect a different warning
on aarch64.
* gcc.dg/declare-simd.c (fn2): Expect a new warning on aarch64.
gcc/config/aarch64/aarch64.c
gcc/testsuite/g++.dg/gomp/declare-simd-1.C
gcc/testsuite/g++.dg/vect/simd-clone-7.cc
gcc/testsuite/gcc.dg/declare-simd.c
gcc/testsuite/gcc.dg/gomp/pr59669-2.c
gcc/testsuite/gcc.dg/gomp/pr99542.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/gomp/simd-clones-2.c