Don't use -Wno-uninitialized in math/
Commit Message
Joseph Myers <joseph@codesourcery.com> writes:
> 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?
This works:
* sysdeps/aarch64/fpu/math_private.h
(libc_feresetround_aarch64_ctx): Suppress maybe-uninitialized
warning.
---
sysdeps/aarch64/fpu/math_private.h | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
Comments
On Mon, 24 Aug 2015, Andreas Schwab wrote:
> Joseph Myers <joseph@codesourcery.com> writes:
>
> > 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?
>
> This works:
>
> * sysdeps/aarch64/fpu/math_private.h
> (libc_feresetround_aarch64_ctx): Suppress maybe-uninitialized
> warning.
Is this still needed given Wilco's patch? If so, it seems fine to me.
Joseph Myers <joseph@codesourcery.com> writes:
> Is this still needed given Wilco's patch?
No, it isn't.
Andreas.
@@ -21,6 +21,7 @@
#include <fenv.h>
#include <fpu_control.h>
+#include <libc-internal.h>
#define math_opt_barrier(x) \
({ __typeof (x) __x = (x); __asm ("" : "+w" (__x)); __x; })
@@ -274,7 +275,15 @@ libc_feresetround_aarch64_ctx (struct rm_ctx *ctx)
{
/* Restore the rounding mode if updated. */
if (__glibc_unlikely (ctx->updated_status))
- _FPU_SETCW (ctx->env.__fpcr);
+ {
+ /* The initialisation of ctx->env.__fpcr in
+ libc_feholdsetround_aarch64_ctx is guarded by the same condition,
+ but GCC doesn't see that. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
+ _FPU_SETCW (ctx->env.__fpcr);
+ DIAG_POP_NEEDS_COMMENT;
+ }
}
#define libc_feresetround_ctx libc_feresetround_aarch64_ctx