dbl-64/e_sqrt.c: fix -Wunused-variable
diff mbox

Message ID 1476979623-890-1-git-send-email-ynorov@caviumnetworks.com
State New
Headers show

Commit Message

Yury Norov Oct. 20, 2016, 4:07 p.m. UTC
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(-)

Comments

Andreas Schwab Nov. 23, 2016, 4:39 p.m. UTC | #1
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.
Yury Norov Nov. 23, 2016, 4:56 p.m. UTC | #2
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.

Patch
diff mbox

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;