diff mbox

Don't use -Wno-uninitialized in math/

Message ID mvmzj1g4w3h.fsf@hawking.suse.de
State Superseded
Headers show

Commit Message

Andreas Schwab Aug. 24, 2015, 2:09 p.m. UTC
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

Joseph Myers Aug. 24, 2015, 2:31 p.m. UTC | #1
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.
Andreas Schwab Aug. 24, 2015, 2:40 p.m. UTC | #2
Joseph Myers <joseph@codesourcery.com> writes:

> Is this still needed given Wilco's patch?

No, it isn't.

Andreas.
diff mbox

Patch

diff --git a/sysdeps/aarch64/fpu/math_private.h b/sysdeps/aarch64/fpu/math_private.h
index 1f02ddb..28c4497 100644
--- a/sysdeps/aarch64/fpu/math_private.h
+++ b/sysdeps/aarch64/fpu/math_private.h
@@ -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