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-351-g0e06902


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  0e069029a8bb132876d315242054a312ae106852 (commit)
      from  d0d286d32dda654f8983e8fe77bca0a2cda2051b (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=0e069029a8bb132876d315242054a312ae106852

commit 0e069029a8bb132876d315242054a312ae106852
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Fri Oct 9 00:32:14 2015 +0000

    Fix dbl-64 lrint for 64-bit long (bug 19095).
    
    The dbl-64 implementation of lrint produces incorrect results for some
    arguments with 64-bit long because a 32-bit (unsigned) low part of the
    mantissa is shifted left, losing high bits in the process.  This patch
    fixes this by casting to long int before shifting, as in lround (as
    this case only applies for 64-bit long, there are no issues with
    sign-extension).
    
    Tested for mips64 (n64).
    
    	[BZ #19095]
    	* sysdeps/ieee754/dbl-64/s_lrint.c (__lrint): Cast low part of
    	mantissa to long int before shifting left.

diff --git a/ChangeLog b/ChangeLog
index 0bfe5f5..1ceae34 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2015-10-09  Joseph Myers  <joseph@codesourcery.com>
+
+	[BZ #19095]
+	* sysdeps/ieee754/dbl-64/s_lrint.c (__lrint): Cast low part of
+	mantissa to long int before shifting left.
+
 2015-10-08  Joseph Myers  <joseph@codesourcery.com>
 
 	[BZ #19094]
diff --git a/NEWS b/NEWS
index 352e468..5c239f3 100644
--- a/NEWS
+++ b/NEWS
@@ -19,7 +19,7 @@ Version 2.23
   18875, 18887, 18921, 18951, 18952, 18956, 18961, 18966, 18967, 18969,
   18970, 18977, 18980, 18981, 18985, 19003, 19012, 19016, 19018, 19032,
   19046, 19049, 19050, 19059, 19071, 19076, 19077, 19078, 19079, 19085,
-  19086, 19088, 19094.
+  19086, 19088, 19094, 19095.
 
 * 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/dbl-64/s_lrint.c b/sysdeps/ieee754/dbl-64/s_lrint.c
index 39f95ad..d004594 100644
--- a/sysdeps/ieee754/dbl-64/s_lrint.c
+++ b/sysdeps/ieee754/dbl-64/s_lrint.c
@@ -61,7 +61,7 @@ __lrint (double x)
   else if (j0 < (int32_t) (8 * sizeof (long int)) - 1)
     {
       if (j0 >= 52)
-	result = ((long int) i0 << (j0 - 20)) | (i1 << (j0 - 52));
+	result = ((long int) i0 << (j0 - 20)) | ((long int) i1 << (j0 - 52));
       else
 	{
 #if defined FE_INVALID || defined FE_INEXACT

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

Summary of changes:
 ChangeLog                        |    6 ++++++
 NEWS                             |    2 +-
 sysdeps/ieee754/dbl-64/s_lrint.c |    2 +-
 3 files changed, 8 insertions(+), 2 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]