about summary refs log tree commit diff
path: root/sysdeps/ieee754/ldbl-96
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2015-02-26 21:49:19 +0000
committerJoseph Myers <joseph@codesourcery.com>2015-02-26 21:49:19 +0000
commit09220e66346dc111ee5b1c5d5bc346f4ca22872e (patch)
tree947c0040fca912942ada850a1eed303fd02a6229 /sysdeps/ieee754/ldbl-96
parent1d9ab20c14211abbf45514e63c190dfeec27fa5e (diff)
downloadglibc-09220e66346dc111ee5b1c5d5bc346f4ca22872e.tar.gz
glibc-09220e66346dc111ee5b1c5d5bc346f4ca22872e.tar.xz
glibc-09220e66346dc111ee5b1c5d5bc346f4ca22872e.zip
Avoid uninitialized warnings in Bessel functions.
math/Makefile currently has:

  # The fdlibm code generates a lot of these warnings but is otherwise clean.
  override CFLAGS += -Wno-uninitialized

This is of course undesirable; warnings should be disabled as narrowly
as possible.  To remove this override, we need to fix files that
generate such warnings, or put warning-disabling pragmas in them.
This patch does so for Bessel function implementations, one of the
cases that have the warnings if the override is removed.  The warnings
arise because functions set pointer variables p and q only for certain
values of the function argument, then use them unconditionally.  As
the static functions in question only get called for arguments that
satisfy the last condition in the if/else chain, the natural fix is to
change the last "else if" to just "else", which this patch does.  (The
ldbl-128 / ldbl-128ibm implementation of these functions is
substantially different and looks like it already does use "else" in
the last case in the nearest corresponding code.)

Tested for x86_64 and x86.

	* sysdeps/ieee754/dbl-64/e_j0.c (pzero): Change last case for
	setting p and q from "else if" to "else".
	(qzero): Likewise.
	* sysdeps/ieee754/dbl-64/e_j1.c (pone): Likewise.
	(qone): Likewise.
	* sysdeps/ieee754/flt-32/e_j0f.c (pzerof): Likewise.
	(qzerof): Likewise.
	* sysdeps/ieee754/flt-32/e_j1f.c (ponef): Likewise.
	(qonef): Likewise.
	* sysdeps/ieee754/ldbl-96/e_j0l.c (pzero): Likewise.
	(qzero): Likewise.
	* sysdeps/ieee754/ldbl-96/e_j1l.c (pone): Likewise.
	(qone): Likewise.
Diffstat (limited to 'sysdeps/ieee754/ldbl-96')
-rw-r--r--sysdeps/ieee754/ldbl-96/e_j0l.c6
-rw-r--r--sysdeps/ieee754/ldbl-96/e_j1l.c6
2 files changed, 8 insertions, 4 deletions
diff --git a/sysdeps/ieee754/ldbl-96/e_j0l.c b/sysdeps/ieee754/ldbl-96/e_j0l.c
index 56f48f1ab9..a536054cde 100644
--- a/sysdeps/ieee754/ldbl-96/e_j0l.c
+++ b/sysdeps/ieee754/ldbl-96/e_j0l.c
@@ -356,6 +356,7 @@ pzero (long double x)
 
   GET_LDOUBLE_WORDS (se, i0, i1, x);
   ix = se & 0x7fff;
+  /* ix >= 0x4000 for all calls to this function.  */
   if (ix >= 0x4002)
     {
       p = pR8;
@@ -374,7 +375,7 @@ pzero (long double x)
 	  p = pR3;
 	  q = pS3;
 	}
-      else if (ix >= 0x4000)	/* x better be >= 2 */
+      else	/* x >= 2 */
 	{
 	  p = pR2;
 	  q = pS2;
@@ -493,6 +494,7 @@ qzero (long double x)
 
   GET_LDOUBLE_WORDS (se, i0, i1, x);
   ix = se & 0x7fff;
+  /* ix >= 0x4000 for all calls to this function.  */
   if (ix >= 0x4002)		/* x >= 8 */
     {
       p = qR8;
@@ -511,7 +513,7 @@ qzero (long double x)
 	  p = qR3;
 	  q = qS3;
 	}
-      else if (ix >= 0x4000)	/* x better be >= 2 */
+      else	/* x >= 2 */
 	{
 	  p = qR2;
 	  q = qS2;
diff --git a/sysdeps/ieee754/ldbl-96/e_j1l.c b/sysdeps/ieee754/ldbl-96/e_j1l.c
index 88fcf1399c..1adc8f669f 100644
--- a/sysdeps/ieee754/ldbl-96/e_j1l.c
+++ b/sysdeps/ieee754/ldbl-96/e_j1l.c
@@ -359,6 +359,7 @@ pone (long double x)
 
   GET_LDOUBLE_WORDS (se, i0, i1, x);
   ix = se & 0x7fff;
+  /* ix >= 0x4000 for all calls to this function.  */
   if (ix >= 0x4002) /* x >= 8 */
     {
       p = pr8;
@@ -377,7 +378,7 @@ pone (long double x)
 	  p = pr3;
 	  q = ps3;
 	}
-      else if (ix >= 0x4000)	/* x better be >= 2 */
+      else	/* x >= 2 */
 	{
 	  p = pr2;
 	  q = ps2;
@@ -505,6 +506,7 @@ qone (long double x)
 
   GET_LDOUBLE_WORDS (se, i0, i1, x);
   ix = se & 0x7fff;
+  /* ix >= 0x4000 for all calls to this function.  */
   if (ix >= 0x4002)		/* x >= 8 */
     {
       p = qr8;
@@ -523,7 +525,7 @@ qone (long double x)
 	  p = qr3;
 	  q = qs3;
 	}
-      else if (ix >= 0x4000)	/* x better be >= 2 */
+      else	/* x >= 2 */
 	{
 	  p = qr2;
 	  q = qs2;