Fix test-math-vector-sincos.h aliasing.
authorJoseph Myers <joseph@codesourcery.com>
Wed, 15 Mar 2017 17:32:46 +0000 (17:32 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Wed, 15 Mar 2017 17:32:46 +0000 (17:32 +0000)
commitffe308e4fcf2f276c87fd405596569ba52ad0a29
tree6d75f028e52fcc225416090f06daaa9a0677758f
parentff80ec4283493958d7ee9ac8e41ca09837f70bcd
Fix test-math-vector-sincos.h aliasing.

x86_64 libmvec tests have been failing to build lately with GCC
mainline with -Wuninitialized errors, and Markus Trippelsdorf traced
this to an aliasing issue
<https://sourceware.org/ml/libc-alpha/2017-03/msg00169.html>.

This patch fixes the aliasing issue, so that the vectors-of-pointers
are initialized using a union instead of pointer casts.  This also
fixes the testsuite build failures with GCC mainline.

Tested for x86_64 (full testsuite with GCC 6; testsuite build with GCC
mainline with build-many-glibcs.py).

* sysdeps/x86/fpu/test-math-vector-sincos.h (INIT_VEC_PTRS_LOOP):
Use a union when storing pointers.
(VECTOR_WRAPPER_fFF_2): Do not take address of integer vector and
cast result when passing to INIT_VEC_PTRS_LOOP.
(VECTOR_WRAPPER_fFF_3): Likewise.
(VECTOR_WRAPPER_fFF_4): Likewise.
ChangeLog
sysdeps/x86/fpu/test-math-vector-sincos.h