public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] dbl-64/e_sqrt.c: fix -Wunused-variable
@ 2016-10-20 16:07 Yury Norov
  2016-11-23 16:39 ` Andreas Schwab
  0 siblings, 1 reply; 3+ messages in thread
From: Yury Norov @ 2016-10-20 16:07 UTC (permalink / raw)
  To: libc-alpha; +Cc: Yury Norov

EMULV() doesn't need p, hx, tx and ty if DLA_FMS is defined.
If that variables are needed for EMULV() only, GCC warns about
unused variables, like this:

../sysdeps/ieee754/dbl-64/e_sqrt.c: In function ‘__ieee754_sqrt’:
../sysdeps/ieee754/dbl-64/e_sqrt.c:56:54: warning: unused variable ‘ty’ [-Wunused-variable]
   double y, t, del, res, res1, hy, z, zz, p, hx, tx, ty, s;
						      ^
This patch fixes it for sysdeps/ieee754/dbl-64/e_sqrt.c where it happens.

	* sysdeps/ieee754/dbl-64/e_sqrt.c
	  (__ieee754_sqrt): declare p, hx, tx and ty conditionally.

Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
---
 sysdeps/ieee754/dbl-64/e_sqrt.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/sysdeps/ieee754/dbl-64/e_sqrt.c b/sysdeps/ieee754/dbl-64/e_sqrt.c
index 8304a2b..d234678 100644
--- a/sysdeps/ieee754/dbl-64/e_sqrt.c
+++ b/sysdeps/ieee754/dbl-64/e_sqrt.c
@@ -53,7 +53,11 @@ __ieee754_sqrt (double x)
     rt2 = 3.75017500867345182581453026130850E-01,
     rt3 = 3.12523626554518656309172508769531E-01;
   static const double big = 134217728.0;
-  double y, t, del, res, res1, hy, z, zz, p, hx, tx, ty, s;
+  double y, t, del, res, res1, hy, z, zz, s;
+#ifndef DLA_FMS
+  double p, hx, tx, ty;
+#endif
+
   mynumber a, c = { { 0, 0 } };
   int4 k;
 
-- 
2.7.4

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] dbl-64/e_sqrt.c: fix -Wunused-variable
  2016-10-20 16:07 [PATCH] dbl-64/e_sqrt.c: fix -Wunused-variable Yury Norov
@ 2016-11-23 16:39 ` Andreas Schwab
  2016-11-23 16:56   ` Yury Norov
  0 siblings, 1 reply; 3+ messages in thread
From: Andreas Schwab @ 2016-11-23 16:39 UTC (permalink / raw)
  To: Yury Norov; +Cc: libc-alpha

On Okt 20 2016, Yury Norov <ynorov@caviumnetworks.com> wrote:

> EMULV() doesn't need p, hx, tx and ty if DLA_FMS is defined.
> If that variables are needed for EMULV() only, GCC warns about
> unused variables, like this:
>
> ../sysdeps/ieee754/dbl-64/e_sqrt.c: In function ‘__ieee754_sqrt’:
> ../sysdeps/ieee754/dbl-64/e_sqrt.c:56:54: warning: unused variable ‘ty’ [-Wunused-variable]
>    double y, t, del, res, res1, hy, z, zz, p, hx, tx, ty, s;
> 						      ^
> This patch fixes it for sysdeps/ieee754/dbl-64/e_sqrt.c where it happens.

You only need that because you are getting the sysdep dir order wrong.
This file should not be used on aarch64, but rather the one in
sysdeps/aarch64/fpu.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] dbl-64/e_sqrt.c: fix -Wunused-variable
  2016-11-23 16:39 ` Andreas Schwab
@ 2016-11-23 16:56   ` Yury Norov
  0 siblings, 0 replies; 3+ messages in thread
From: Yury Norov @ 2016-11-23 16:56 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: libc-alpha

On Wed, Nov 23, 2016 at 05:39:11PM +0100, Andreas Schwab wrote:
> On Okt 20 2016, Yury Norov <ynorov@caviumnetworks.com> wrote:
> 
> > EMULV() doesn't need p, hx, tx and ty if DLA_FMS is defined.
> > If that variables are needed for EMULV() only, GCC warns about
> > unused variables, like this:
> >
> > ../sysdeps/ieee754/dbl-64/e_sqrt.c: In function ‘__ieee754_sqrt’:
> > ../sysdeps/ieee754/dbl-64/e_sqrt.c:56:54: warning: unused variable ‘ty’ [-Wunused-variable]
> >    double y, t, del, res, res1, hy, z, zz, p, hx, tx, ty, s;
> > 						      ^
> > This patch fixes it for sysdeps/ieee754/dbl-64/e_sqrt.c where it happens.
> 
> You only need that because you are getting the sysdep dir order wrong.
> This file should not be used on aarch64, but rather the one in
> sysdeps/aarch64/fpu.

Yes, it works. Thank you.

Yury.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-11-23 16:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-20 16:07 [PATCH] dbl-64/e_sqrt.c: fix -Wunused-variable Yury Norov
2016-11-23 16:39 ` Andreas Schwab
2016-11-23 16:56   ` Yury Norov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).