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.22-242-gdfa0f62


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  dfa0f62011b50cc36107df5fad4130c5368b11e1 (commit)
      from  223d1cacc5dafe8af53e84608c2d130721c4edcd (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=dfa0f62011b50cc36107df5fad4130c5368b11e1

commit dfa0f62011b50cc36107df5fad4130c5368b11e1
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Tue Sep 15 20:48:05 2015 +0000

    Fix ldbl-128ibm nearbyintl use of signaling comparisons on NaNs (bug 18857).
    
    The ldbl-128ibm implementation of nearbyintl wrongly uses signaling
    comparisons such as "if (fabs (u.d[0].d) < TWO52)" on arguments that
    might be NaNs, when "invalid" exceptions should not be raised.  (For
    hard float, this issue may be hidden by
    <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58684>, powerpc GCC
    wrongly only using unordered comparison instructions.)  This patch
    fixes this by just returning the argument if it is not finite (because
    of the arbitrary value of the low part of a NaN in IBM long double,
    there are quite a lot of comparisons that could end up involving a NaN
    when the argument to nearbyintl is a NaN, so excluding NaN arguments
    at the start is the simplest and safest fix).
    
    Tested for powerpc-nofpu, where it removes failures for spurious
    "invalid" exceptions from nearbyintl.
    
    	[BZ #18857]
    	* sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c (__nearbyintl): Just
    	return non-finite argument without doing ordered comparisons on
    	it.

diff --git a/ChangeLog b/ChangeLog
index fd28199..5053bf3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2015-09-15  Joseph Myers  <joseph@codesourcery.com>
 
+	[BZ #18857]
+	* sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c (__nearbyintl): Just
+	return non-finite argument without doing ordered comparisons on
+	it.
+
 	[BZ #16296]
 	* math/fenv.h (fegetround): Use __attribute_pure__.
 	* include/fenv.h (__fegetround): Likewise.
diff --git a/NEWS b/NEWS
index b35d542..5db57a2 100644
--- a/NEWS
+++ b/NEWS
@@ -13,8 +13,8 @@ Version 2.23
   16519, 16520, 16521, 16734, 16973, 16985, 17787, 17905, 18084, 18086,
   18240, 18265, 18370, 18421, 18480, 18525, 18595, 18610, 18618, 18647,
   18661, 18674, 18675, 18681, 18757, 18778, 18781, 18787, 18789, 18790,
-  18795, 18796, 18820, 18823, 18824, 18863, 18870, 18873, 18875, 18887,
-  18921, 18952, 18961, 18966.
+  18795, 18796, 18820, 18823, 18824, 18857, 18863, 18870, 18873, 18875,
+  18887, 18921, 18952, 18961, 18966.
 
 * The obsolete header <regexp.h> has been removed.  Programs that require
   this header must be updated to use <regex.h> instead.
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c b/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c
index 5f92a5f..99f4747 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c
@@ -36,7 +36,9 @@ __nearbyintl (long double x)
   union ibm_extended_long_double u;
   u.ld = x;
 
-  if (fabs (u.d[0].d) < TWO52)
+  if (!isfinite (u.d[0].d))
+    return x;
+  else if (fabs (u.d[0].d) < TWO52)
     {
       double xh = u.d[0].d;
       double high = u.d[0].d;

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

Summary of changes:
 ChangeLog                                  |    5 +++++
 NEWS                                       |    4 ++--
 sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c |    4 +++-
 3 files changed, 10 insertions(+), 3 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]