This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Don't use -Wno-uninitialized in math/
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Andreas Schwab <schwab at suse dot de>
- Cc: <libc-alpha at sourceware dot org>
- Date: Mon, 24 Aug 2015 11:26:39 +0000
- Subject: Re: Don't use -Wno-uninitialized in math/
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot DEB dot 2 dot 10 dot 1508201800380 dot 30940 at digraph dot polyomino dot org dot uk> <mvma8th7zw6 dot fsf at hawking dot suse dot de>
On Mon, 24 Aug 2015, Andreas Schwab wrote:
> That breaks aarch64.
>
> In file included from ../include/fpu_control.h:1:0,
> from ../sysdeps/aarch64/fpu/math_private.h:23,
> from ../sysdeps/ieee754/dbl-64/e_exp.c:41:
> ../sysdeps/ieee754/dbl-64/e_exp.c: In function '__ieee754_exp':
> ../sysdeps/aarch64/fpu/fpu_control.h:28:3: error: 'ctx.env.__fpcr' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> __asm__ __volatile__ ("msr fpcr, %0" : : "r" (fpcr))
> ^
> In file included from ../sysdeps/ieee754/flt-32/math_private.h:3:0,
> from ../sysdeps/ieee754/dbl-64/wordsize-64/math_private.h:3,
> from ../sysdeps/aarch64/fpu/math_private.h:326,
> from ../sysdeps/ieee754/dbl-64/e_exp.c:41:
> ../sysdeps/generic/math_private.h:652:17: note: 'ctx.env.__fpcr' was declared here
> struct rm_ctx ctx __attribute__((cleanup (CLEANUPFUNC ## _ctx))); \
> ^
> ../sysdeps/generic/math_private.h:661:3: note: in expansion of macro 'SET_RESTORE_ROUND_GENERIC'
> SET_RESTORE_ROUND_GENERIC (RM, libc_feholdsetround, libc_feresetround)
> ^
> ../sysdeps/ieee754/dbl-64/e_exp.c:63:5: note: in expansion of macro 'SET_RESTORE_ROUND'
> SET_RESTORE_ROUND (FE_TONEAREST);
> ^
Does putting the DIAG_* macros (with appropriate comments) in the relevant
inline functions (possibly libc_feresetround_aarch64_ctx or
libc_feresetround_noex_aarch64_ctx) help? That would seem to be the right
approach for this (if the issue is that ctx.env.__fpcr is only used if
ctx.updated_status, which is only true if ctx.env.__fpcr was set earlier,
but the compiler can't see this). (Failing that, maybe selected files
need -Wno-uninitialized for aarch64, which would still be better than
having it globally for all of math/ on all architectures.)
--
Joseph S. Myers
joseph@codesourcery.com