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.18-467-g2a77a46


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  2a77a467b273c1a72fa204a8fcc6d22e6e20bb1c (commit)
      from  ea3bc4e821e20e70b093c9a33e54f99c79e0d847 (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=2a77a467b273c1a72fa204a8fcc6d22e6e20bb1c

commit 2a77a467b273c1a72fa204a8fcc6d22e6e20bb1c
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Fri Nov 29 16:32:49 2013 +0000

    Fix exp10 errno setting on underflow (bug 6787).

diff --git a/ChangeLog b/ChangeLog
index 25e7725..80a65ea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2013-11-29  Joseph Myers  <joseph@codesourcery.com>
 
+	[BZ #6787]
+	* math/w_exp10.c (__exp10): Handle a zero result as underflow.
+	* math/w_exp10f.c (__exp10f): Likewise.
+	* math/w_exp10l.c (__exp10l): Likewise.
+	* math/libm-test.inc (exp10_test_data): Add more tests and expect
+	errno settings in existing tests.
+
 	[BZ #14032]
 	* sysdeps/i386/fpu/e_sqrt.S (__ieee754_sqrt): Do fsqrt with
 	precision control set to double precision.
diff --git a/NEWS b/NEWS
index 0115c8f..e85b4c6 100644
--- a/NEWS
+++ b/NEWS
@@ -9,17 +9,18 @@ Version 2.19
 
 * The following bugs are resolved with this release:
 
-  156, 387, 431, 832, 2801, 7003, 9954, 10253, 10278, 11087, 11157, 11214,
-  13028, 13982, 13985, 14029, 14032, 14143, 14155, 14547, 14699, 14752,
-  14876, 14910, 15004, 15048, 15218, 15277, 15308, 15362, 15374, 15400,
-  15427, 15483, 15522, 15531, 15532, 15601, 15608, 15609, 15610, 15632,
-  15640, 15670, 15672, 15680, 15681, 15723, 15734, 15735, 15736, 15748,
-  15749, 15754, 15760, 15763, 15764, 15797, 15799, 15825, 15844, 15847,
-  15849, 15855, 15856, 15857, 15859, 15867, 15886, 15887, 15890, 15892,
-  15893, 15895, 15897, 15905, 15909, 15917, 15919, 15921, 15923, 15939,
-  15948, 15963, 15966, 15985, 15988, 15997, 16032, 16034, 16036, 16037,
-  16041, 16055, 16071, 16072, 16074, 16077, 16078, 16103, 16112, 16143,
-  16144, 16146, 16150, 16151, 16153, 16167, 16172, 16214, 16245, 16271.
+  156, 387, 431, 832, 2801, 6787, 7003, 9954, 10253, 10278, 11087, 11157,
+  11214, 13028, 13982, 13985, 14029, 14032, 14143, 14155, 14547, 14699,
+  14752, 14876, 14910, 15004, 15048, 15218, 15277, 15308, 15362, 15374,
+  15400, 15427, 15483, 15522, 15531, 15532, 15601, 15608, 15609, 15610,
+  15632, 15640, 15670, 15672, 15680, 15681, 15723, 15734, 15735, 15736,
+  15748, 15749, 15754, 15760, 15763, 15764, 15797, 15799, 15825, 15844,
+  15847, 15849, 15855, 15856, 15857, 15859, 15867, 15886, 15887, 15890,
+  15892, 15893, 15895, 15897, 15905, 15909, 15917, 15919, 15921, 15923,
+  15939, 15948, 15963, 15966, 15985, 15988, 15997, 16032, 16034, 16036,
+  16037, 16041, 16055, 16071, 16072, 16074, 16077, 16078, 16103, 16112,
+  16143, 16144, 16146, 16150, 16151, 16153, 16167, 16172, 16214, 16245,
+  16271.
 
 * The public headers no longer use __unused nor __block.  This change is to
   support compiling programs that are derived from BSD sources and use
diff --git a/math/libm-test.inc b/math/libm-test.inc
index 7c599c1..6e9d37a 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -8134,10 +8134,12 @@ static const struct test_f_f_data exp10_test_data[] =
     TEST_f_f (exp10, 4932, 1.0e4932L),
     TEST_f_f (exp10, -4932, 1.0e-4932L, UNDERFLOW_EXCEPTION),
 #endif
+    TEST_f_f (exp10, 1e5, plus_infty, OVERFLOW_EXCEPTION|ERRNO_ERANGE),
+    TEST_f_f (exp10, -1e5, 0, UNDERFLOW_EXCEPTION|ERRNO_ERANGE),
     TEST_f_f (exp10, 1e6, plus_infty, OVERFLOW_EXCEPTION|ERRNO_ERANGE),
-    TEST_f_f (exp10, -1e6, 0, UNDERFLOW_EXCEPTION),
+    TEST_f_f (exp10, -1e6, 0, UNDERFLOW_EXCEPTION|ERRNO_ERANGE),
     TEST_f_f (exp10, max_value, plus_infty, OVERFLOW_EXCEPTION|ERRNO_ERANGE),
-    TEST_f_f (exp10, -max_value, 0, UNDERFLOW_EXCEPTION),
+    TEST_f_f (exp10, -max_value, 0, UNDERFLOW_EXCEPTION|ERRNO_ERANGE),
     TEST_f_f (exp10, 0.75L, 5.62341325190349080394951039776481231L),
   };
 
diff --git a/math/w_exp10.c b/math/w_exp10.c
index 3db012d..17823f5 100644
--- a/math/w_exp10.c
+++ b/math/w_exp10.c
@@ -28,7 +28,7 @@ double
 __exp10 (double x)
 {
   double z = __ieee754_exp10 (x);
-  if (__builtin_expect (!__finite (z), 0)
+  if (__builtin_expect (!__finite (z) || z == 0, 0)
       && __finite (x) && _LIB_VERSION != _IEEE_)
     /* exp10 overflow (46) if x > 0, underflow (47) if x < 0.  */
     return __kernel_standard (x, x, 46 + !!__signbit (x));
diff --git a/math/w_exp10f.c b/math/w_exp10f.c
index 082b34f..e2f9185 100644
--- a/math/w_exp10f.c
+++ b/math/w_exp10f.c
@@ -28,7 +28,7 @@ float
 __exp10f (float x)
 {
   float z = __ieee754_exp10f (x);
-  if (__builtin_expect (!__finitef (z), 0)
+  if (__builtin_expect (!__finitef (z) || z == 0, 0)
       && __finitef (x) && _LIB_VERSION != _IEEE_)
     /* exp10f overflow (146) if x > 0, underflow (147) if x < 0.  */
     return __kernel_standard_f (x, x, 146 + !!__signbitf (x));
diff --git a/math/w_exp10l.c b/math/w_exp10l.c
index 10f3f81..19facdd 100644
--- a/math/w_exp10l.c
+++ b/math/w_exp10l.c
@@ -28,7 +28,7 @@ long double
 __exp10l (long double x)
 {
   long double z = __ieee754_exp10l (x);
-  if (__builtin_expect (!__finitel (z), 0)
+  if (__builtin_expect (!__finitel (z) || z == 0, 0)
       && __finitel (x) && _LIB_VERSION != _IEEE_)
     /* exp10l overflow (246) if x > 0, underflow (247) if x < 0.  */
     return __kernel_standard_l (x, x, 246 + !!__signbitl (x));

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

Summary of changes:
 ChangeLog          |    7 +++++++
 NEWS               |   23 ++++++++++++-----------
 math/libm-test.inc |    6 ++++--
 math/w_exp10.c     |    2 +-
 math/w_exp10f.c    |    2 +-
 math/w_exp10l.c    |    2 +-
 6 files changed, 26 insertions(+), 16 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]