This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.17-567-gf030294


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  f0302940e7c2acb587971e3c99dfbd00aa4e2134 (commit)
      from  aa630f590c9c7d070a7cdf3a2a88069ad6b63de9 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=f0302940e7c2acb587971e3c99dfbd00aa4e2134

commit f0302940e7c2acb587971e3c99dfbd00aa4e2134
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Fri Apr 26 19:25:19 2013 +0000

    Fix csin, csinh, ccos, ccosh missing underflows (bug 15405).

diff --git a/ChangeLog b/ChangeLog
index 2900e14..1996e6c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2013-04-26  Joseph Myers  <joseph@codesourcery.com>
+
+	[BZ #15405]
+	* math/s_ccosh.c (__ccosh): Ensure underflow exception occurs for
+	underflowed result.
+	* math/s_ccoshf.c (__ccoshf): Likewise.
+	* math/s_ccoshl.c (__ccoshl): Likewise.
+	* math/s_csin.c (__csin): Likewise.
+	* math/s_csinf.c (__csinf): Likewise.
+	* math/s_csinh.c (__csinh): Likewise.
+	* math/s_csinhf.c (__csinhf): Likewise.
+	* math/s_csinhl.c (__csinhl): Likewise.
+	* math/s_csinl.c (__csinl): Likewise.
+	* math/libm-test.inc (ccos_test): Add more tests.
+	(ccosh_test): Likewise.
+	(csin_test): Likewise.
+	(csinh_test): Likewise.
+
 2013-04-26  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
 
 	* sysdeps/powerpc/power5/fpu/s_modf.c: Moved to ...
diff --git a/NEWS b/NEWS
index c5b57a8..f986862 100644
--- a/NEWS
+++ b/NEWS
@@ -14,7 +14,7 @@ Version 2.18
   14812, 14888, 14920, 14964, 14981, 14982, 14985, 14994, 14996, 15003,
   15006, 15020, 15023, 15036, 15054, 15055, 15062, 15078, 15160, 15214,
   15232, 15234, 15283, 15285, 15287, 15304, 15305, 15307, 15309, 15327,
-  15330, 15335, 15336, 15337, 15342, 15346, 15361, 15366, 15394.
+  15330, 15335, 15336, 15337, 15342, 15346, 15361, 15366, 15394, 15405.
 
 * CVE-2013-0242 Buffer overrun in regexp matcher has been fixed (Bugzilla
   #15078).
diff --git a/math/libm-test.inc b/math/libm-test.inc
index eb9fa71..a3d7731 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -4570,6 +4570,9 @@ ccos_test (void)
   TEST_c_c (ccos, 0x1p-16434L, 22730, plus_infty, -1.217853148905605987081057582351152052687e4924L, OVERFLOW_EXCEPTION);
 #endif
 
+  TEST_c_c (ccos, min_subnorm_value * 0x1p120, 0x1p-120, 1.0, -min_subnorm_value, UNDERFLOW_EXCEPTION);
+  TEST_c_c (ccos, 0x1p-120, min_subnorm_value * 0x1p120, 1.0, -min_subnorm_value, UNDERFLOW_EXCEPTION);
+
   END (ccos, complex);
 }
 
@@ -4670,6 +4673,9 @@ ccosh_test (void)
   TEST_c_c (ccosh, 22730, 0x1p-16434L, plus_infty, 1.217853148905605987081057582351152052687e4924L, OVERFLOW_EXCEPTION);
 #endif
 
+  TEST_c_c (ccosh, min_subnorm_value * 0x1p120, 0x1p-120, 1.0, min_subnorm_value, UNDERFLOW_EXCEPTION);
+  TEST_c_c (ccosh, 0x1p-120, min_subnorm_value * 0x1p120, 1.0, min_subnorm_value, UNDERFLOW_EXCEPTION);
+
   END (ccosh, complex);
 }
 
@@ -5898,6 +5904,9 @@ csin_test (void)
   TEST_c_c (csin, 0x1p-16434L, 22730, 1.217853148905605987081057582351152052687e4924L, plus_infty, OVERFLOW_EXCEPTION);
 #endif
 
+  TEST_c_c (csin, min_subnorm_value, min_value, min_subnorm_value, min_value, UNDERFLOW_EXCEPTION);
+  TEST_c_c (csin, min_value, min_subnorm_value, min_value, min_subnorm_value, UNDERFLOW_EXCEPTION);
+
   END (csin, complex);
 }
 
@@ -5997,6 +6006,9 @@ csinh_test (void)
   TEST_c_c (csinh, 22730, 0x1p-16434L, plus_infty, 1.217853148905605987081057582351152052687e4924L, OVERFLOW_EXCEPTION);
 #endif
 
+  TEST_c_c (csinh, min_subnorm_value, min_value, min_subnorm_value, min_value, UNDERFLOW_EXCEPTION);
+  TEST_c_c (csinh, min_value, min_subnorm_value, min_value, min_subnorm_value, UNDERFLOW_EXCEPTION);
+
   END (csinh, complex);
 }
 
diff --git a/math/s_ccosh.c b/math/s_ccosh.c
index 2c05b63..05b146e 100644
--- a/math/s_ccosh.c
+++ b/math/s_ccosh.c
@@ -82,6 +82,19 @@ __ccosh (__complex__ double x)
 	      __real__ retval = __ieee754_cosh (__real__ x) * cosix;
 	      __imag__ retval = __ieee754_sinh (__real__ x) * sinix;
 	    }
+
+	  if (fabs (__real__ retval) < DBL_MIN)
+	    {
+	      volatile double force_underflow
+		= __real__ retval * __real__ retval;
+	      (void) force_underflow;
+	    }
+	  if (fabs (__imag__ retval) < DBL_MIN)
+	    {
+	      volatile double force_underflow
+		= __imag__ retval * __imag__ retval;
+	      (void) force_underflow;
+	    }
 	}
       else
 	{
diff --git a/math/s_ccoshf.c b/math/s_ccoshf.c
index de7e7d3..62bf83c 100644
--- a/math/s_ccoshf.c
+++ b/math/s_ccoshf.c
@@ -82,6 +82,19 @@ __ccoshf (__complex__ float x)
 	      __real__ retval = __ieee754_coshf (__real__ x) * cosix;
 	      __imag__ retval = __ieee754_sinhf (__real__ x) * sinix;
 	    }
+
+	  if (fabsf (__real__ retval) < FLT_MIN)
+	    {
+	      volatile float force_underflow
+		= __real__ retval * __real__ retval;
+	      (void) force_underflow;
+	    }
+	  if (fabsf (__imag__ retval) < FLT_MIN)
+	    {
+	      volatile float force_underflow
+		= __imag__ retval * __imag__ retval;
+	      (void) force_underflow;
+	    }
 	}
       else
 	{
diff --git a/math/s_ccoshl.c b/math/s_ccoshl.c
index 4bbd311..18d3df0 100644
--- a/math/s_ccoshl.c
+++ b/math/s_ccoshl.c
@@ -82,6 +82,19 @@ __ccoshl (__complex__ long double x)
 	      __real__ retval = __ieee754_coshl (__real__ x) * cosix;
 	      __imag__ retval = __ieee754_sinhl (__real__ x) * sinix;
 	    }
+
+	  if (fabsl (__real__ retval) < LDBL_MIN)
+	    {
+	      volatile long double force_underflow
+		= __real__ retval * __real__ retval;
+	      (void) force_underflow;
+	    }
+	  if (fabsl (__imag__ retval) < LDBL_MIN)
+	    {
+	      volatile long double force_underflow
+		= __imag__ retval * __imag__ retval;
+	      (void) force_underflow;
+	    }
 	}
       else
 	{
diff --git a/math/s_csin.c b/math/s_csin.c
index cc1c9cd..6d28e4c 100644
--- a/math/s_csin.c
+++ b/math/s_csin.c
@@ -88,6 +88,19 @@ __csin (__complex__ double x)
 
 	  if (negate)
 	    __real__ retval = -__real__ retval;
+
+	  if (fabs (__real__ retval) < DBL_MIN)
+	    {
+	      volatile double force_underflow
+		= __real__ retval * __real__ retval;
+	      (void) force_underflow;
+	    }
+	  if (fabs (__imag__ retval) < DBL_MIN)
+	    {
+	      volatile double force_underflow
+		= __imag__ retval * __imag__ retval;
+	      (void) force_underflow;
+	    }
 	}
       else
 	{
diff --git a/math/s_csinf.c b/math/s_csinf.c
index 92b858a..a3dcf9d 100644
--- a/math/s_csinf.c
+++ b/math/s_csinf.c
@@ -88,6 +88,19 @@ __csinf (__complex__ float x)
 
 	  if (negate)
 	    __real__ retval = -__real__ retval;
+
+	  if (fabsf (__real__ retval) < FLT_MIN)
+	    {
+	      volatile float force_underflow
+		= __real__ retval * __real__ retval;
+	      (void) force_underflow;
+	    }
+	  if (fabsf (__imag__ retval) < FLT_MIN)
+	    {
+	      volatile float force_underflow
+		= __imag__ retval * __imag__ retval;
+	      (void) force_underflow;
+	    }
 	}
       else
 	{
diff --git a/math/s_csinh.c b/math/s_csinh.c
index be3c6bb..5a98f67 100644
--- a/math/s_csinh.c
+++ b/math/s_csinh.c
@@ -88,6 +88,19 @@ __csinh (__complex__ double x)
 
 	  if (negate)
 	    __real__ retval = -__real__ retval;
+
+	  if (fabs (__real__ retval) < DBL_MIN)
+	    {
+	      volatile double force_underflow
+		= __real__ retval * __real__ retval;
+	      (void) force_underflow;
+	    }
+	  if (fabs (__imag__ retval) < DBL_MIN)
+	    {
+	      volatile double force_underflow
+		= __imag__ retval * __imag__ retval;
+	      (void) force_underflow;
+	    }
 	}
       else
 	{
diff --git a/math/s_csinhf.c b/math/s_csinhf.c
index 6c58c1d..3658805 100644
--- a/math/s_csinhf.c
+++ b/math/s_csinhf.c
@@ -88,6 +88,19 @@ __csinhf (__complex__ float x)
 
 	  if (negate)
 	    __real__ retval = -__real__ retval;
+
+	  if (fabsf (__real__ retval) < FLT_MIN)
+	    {
+	      volatile float force_underflow
+		= __real__ retval * __real__ retval;
+	      (void) force_underflow;
+	    }
+	  if (fabsf (__imag__ retval) < FLT_MIN)
+	    {
+	      volatile float force_underflow
+		= __imag__ retval * __imag__ retval;
+	      (void) force_underflow;
+	    }
 	}
       else
 	{
diff --git a/math/s_csinhl.c b/math/s_csinhl.c
index 8acf6de..54a13fd 100644
--- a/math/s_csinhl.c
+++ b/math/s_csinhl.c
@@ -88,6 +88,19 @@ __csinhl (__complex__ long double x)
 
 	  if (negate)
 	    __real__ retval = -__real__ retval;
+
+	  if (fabsl (__real__ retval) < LDBL_MIN)
+	    {
+	      volatile long double force_underflow
+		= __real__ retval * __real__ retval;
+	      (void) force_underflow;
+	    }
+	  if (fabsl (__imag__ retval) < LDBL_MIN)
+	    {
+	      volatile long double force_underflow
+		= __imag__ retval * __imag__ retval;
+	      (void) force_underflow;
+	    }
 	}
       else
 	{
diff --git a/math/s_csinl.c b/math/s_csinl.c
index 6b3c1ea..4d6ce3d 100644
--- a/math/s_csinl.c
+++ b/math/s_csinl.c
@@ -88,6 +88,19 @@ __csinl (__complex__ long double x)
 
 	  if (negate)
 	    __real__ retval = -__real__ retval;
+
+	  if (fabsl (__real__ retval) < LDBL_MIN)
+	    {
+	      volatile long double force_underflow
+		= __real__ retval * __real__ retval;
+	      (void) force_underflow;
+	    }
+	  if (fabsl (__imag__ retval) < LDBL_MIN)
+	    {
+	      volatile long double force_underflow
+		= __imag__ retval * __imag__ retval;
+	      (void) force_underflow;
+	    }
 	}
       else
 	{

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog          |   18 ++++++++++++++++++
 NEWS               |    2 +-
 math/libm-test.inc |   12 ++++++++++++
 math/s_ccosh.c     |   13 +++++++++++++
 math/s_ccoshf.c    |   13 +++++++++++++
 math/s_ccoshl.c    |   13 +++++++++++++
 math/s_csin.c      |   13 +++++++++++++
 math/s_csinf.c     |   13 +++++++++++++
 math/s_csinh.c     |   13 +++++++++++++
 math/s_csinhf.c    |   13 +++++++++++++
 math/s_csinhl.c    |   13 +++++++++++++
 math/s_csinl.c     |   13 +++++++++++++
 12 files changed, 148 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]