[AArch64] Fix strict aliasing issue in gcc.target/aarch64/simd/vminmaxnm_1.c
commit6fe3562b972f3f7f1c4db7ef7d5e6081b93bb3b3
authorktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 4 Jul 2017 15:19:30 +0000 (4 15:19 +0000)
committerktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 4 Jul 2017 15:19:30 +0000 (4 15:19 +0000)
tree310ea9d605948ad95674b68d4a99d9ea310e4723
parentbf8761c891d1951e2ec68d9ef2c48d8e10c65c62
[AArch64] Fix strict aliasing issue in gcc.target/aarch64/simd/vminmaxnm_1.c

While doing some unrelated work the gcc.target/aarch64/simd/vminmaxnm_1.c testcase started failing for me.
Upon investigation it turns out that it breaks the C strict aliasing rules in the CHECK macro by casting
a pointer to an incompatible type and dereferencing it. GCC even warns about it if compiled with -Wstrict-aliasing.

This patch fixes the testcase by making it use memcmp to compare the vector elements.
This avoids the undefined behaviour.

The testcase still passes on trunk.

    * gcc.target/aarch64/simd/vminmaxnm_1.c: Fix strict aliasing issues.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@249972 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/aarch64/simd/vminmaxnm_1.c