This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Uninitialized error with GCC mainline


On 2017.03.10 at 16:41 +0000, Joseph Myers wrote:
> On Wed, 8 Mar 2017, Markus Trippelsdorf wrote:
> 
> > > There are many more similar warnings later on.
> > > This started with gcc's rr245840. It would be could if someone could
> > > analyze the issues and open gcc bugs if necessary.
> > 
> > The issue was fixed by gcc's r245976. I can now build glibc with gcc
> > trunk without any warning at -O3.
> 
> I don't know if it's a remaining case of the same issue, or something 
> else, but there are still -Wuninitialized errors building the testsuite 
> for x86_64 with GCC mainline.
> 
> ../sysdeps/x86_64/fpu/test-double-vlen4-wrappers.c: In function 'sincos_vlen4':
> ../sysdeps/x86_64/fpu/test-double-vlen4-wrappers.c:34:46: error: 'mr1' is used uninitialized in this function [-Werror=uninitialized]
>  VECTOR_WRAPPER_fFF_3 (WRAPPER_NAME (sincos), _ZGVcN4vvv_sincos)

This one looks legitimate. In sysdeps/x86/fpu/test-math-vector-sincos.h
it seems that r_loc[], r1_loc[] and  mr, mr1 should be initialized.

53 /* Wrapper for vector sincos/sincosf compatible with x86_64 variants of
54    _ZGVcN4vvv_sincos, _ZGVeN16vvv_sincosf, _ZGVbN4vvv_sincosf,
55    _ZGVdN8vvv_sincosf, _ZGVcN8vvv_sincosf.  */
56 #define VECTOR_WRAPPER_fFF_3(scalar_func, vector_func)          \
57 extern void vector_func (VEC_TYPE, VEC_INT_TYPE, VEC_INT_TYPE,  \
58                          VEC_INT_TYPE, VEC_INT_TYPE);           \
59 void scalar_func (FLOAT x, FLOAT * r, FLOAT * r1)               \
60 {                                                               \
61   int i;                                                        \
62   FLOAT r_loc[VEC_LEN/2], r1_loc[VEC_LEN/2];                    \
63   VEC_TYPE mx;                                                  \
64   VEC_INT_TYPE mr, mr1;                                         \
65   INIT_VEC_LOOP (mx, x, VEC_LEN);                               \
66   INIT_VEC_PTRS_LOOP (((FLOAT **) &mr), r_loc, VEC_LEN/2);      \
67   INIT_VEC_PTRS_LOOP (((FLOAT **) &mr1), r1_loc, VEC_LEN/2);    \
68   vector_func (mx, mr, mr, mr1, mr1);                           \
69   TEST_VEC_LOOP (r_loc, VEC_LEN/2);                             \
70   TEST_VEC_LOOP (r1_loc, VEC_LEN/2);                            \
71   *r = r_loc[0];                                                \
72   *r1 = r1_loc[0];                                              \
73   return;                                                       \
74 }

-- 
Markus


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]