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.26-9-g42df8d5


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  42df8d5921d9ce28f44694ae943efb432b5e9aa7 (commit)
      from  b7f95f493b47abfd8f6320b3492b25a2beaa6aa1 (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=42df8d5921d9ce28f44694ae943efb432b5e9aa7

commit 42df8d5921d9ce28f44694ae943efb432b5e9aa7
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Wed Aug 2 20:16:05 2017 +0000

    Fix tgmath.h for __int128 (bug 21686).
    
    When a tgmath.h macro is passed a double argument and an argument of
    type __int128, it generates a call to a long double function (although
    the result still gets converted to type double).  __int128 is similar
    enough to integer types that it should be handled consistently like
    them, so always like double for these macros rather than sometimes
    like double and sometimes like long double.  This patch fixes the
    logic accordingly and makes gen-tgmath-tests.py generate tests for
    __int128.
    
    Tested for x86_64 and x86.
    
    	[BZ #21686]
    	* math/tgmath.h (__TGMATH_BINARY_REAL_ONLY): Add arguments before
    	comparing size with that of double.
    	(__TGMATH_BINARY_REAL_STD_ONLY): Likewise.
    	(__TGMATH_BINARY_REAL_RET_ONLY): Likewise.
    	(__TGMATH_TERNARY_FIRST_SECOND_REAL_ONLY): Likewise.
    	(__TGMATH_TERNARY_REAL_ONLY): Likewise.
    	(__TGMATH_BINARY_REAL_IMAG): Likewise.
    	* math/gen-tgmath-tests.py (Type.init_types): Create __int128 and
    	unsigned __int128 types.

diff --git a/ChangeLog b/ChangeLog
index 2125236..a3bc654 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2017-08-02  Joseph Myers  <joseph@codesourcery.com>
+
+	[BZ #21686]
+	* math/tgmath.h (__TGMATH_BINARY_REAL_ONLY): Add arguments before
+	comparing size with that of double.
+	(__TGMATH_BINARY_REAL_STD_ONLY): Likewise.
+	(__TGMATH_BINARY_REAL_RET_ONLY): Likewise.
+	(__TGMATH_TERNARY_FIRST_SECOND_REAL_ONLY): Likewise.
+	(__TGMATH_TERNARY_REAL_ONLY): Likewise.
+	(__TGMATH_BINARY_REAL_IMAG): Likewise.
+	* math/gen-tgmath-tests.py (Type.init_types): Create __int128 and
+	unsigned __int128 types.
+
 2017-08-02  Steve Ellcey  <sellcey@cavium.com>
 
 	* localedata/Makefile (CFLAGS-tst_iswalnum.c, CFLAGS-tst_iswalpha.c
diff --git a/math/gen-tgmath-tests.py b/math/gen-tgmath-tests.py
index e749e3d..9044670 100755
--- a/math/gen-tgmath-tests.py
+++ b/math/gen-tgmath-tests.py
@@ -195,6 +195,10 @@ class Type(object):
         Type.create_type('unsigned long int', integer=True)
         Type.create_type('long long int', integer=True)
         Type.create_type('unsigned long long int', integer=True)
+        Type.create_type('__int128', integer=True,
+                         condition='defined __SIZEOF_INT128__')
+        Type.create_type('unsigned __int128', integer=True,
+                         condition='defined __SIZEOF_INT128__')
         Type.create_type('enum e', integer=True, complex_ok=False)
         Type.create_type('_Bool', integer=True, complex_ok=False)
         Type.create_type('bit_field', integer=True, complex_ok=False)
diff --git a/math/tgmath.h b/math/tgmath.h
index 211948c..019f072 100644
--- a/math/tgmath.h
+++ b/math/tgmath.h
@@ -129,8 +129,7 @@
 		     : (__tgmath_real_type (Val1)) __tgml(Fct) (Val1, Val2)))
 
 # define __TGMATH_BINARY_REAL_ONLY(Val1, Val2, Fct) \
-     (__extension__ (((sizeof (+(Val1)) > sizeof (double)		      \
-		       || sizeof (+(Val2)) > sizeof (double))		      \
+     (__extension__ ((sizeof ((Val1) + (Val2)) > sizeof (double)	      \
 		      && __builtin_classify_type ((Val1) + (Val2)) == 8)      \
 		     ? __TGMATH_F128 ((Val1) + (Val2),			      \
 				      (__typeof				      \
@@ -152,8 +151,7 @@
 		       Fct##f (Val1, Val2)))
 
 # define __TGMATH_BINARY_REAL_STD_ONLY(Val1, Val2, Fct) \
-     (__extension__ (((sizeof (+(Val1)) > sizeof (double)		      \
-		       || sizeof (+(Val2)) > sizeof (double))		      \
+     (__extension__ ((sizeof ((Val1) + (Val2)) > sizeof (double)	      \
 		      && __builtin_classify_type ((Val1) + (Val2)) == 8)      \
 		     ? (__typeof ((__tgmath_real_type (Val1)) 0		      \
 				  + (__tgmath_real_type (Val2)) 0))	      \
@@ -170,8 +168,7 @@
 		       Fct##f (Val1, Val2)))
 
 # define __TGMATH_BINARY_REAL_RET_ONLY(Val1, Val2, Fct) \
-     (__extension__ (((sizeof (+(Val1)) > sizeof (double)		      \
-		       || sizeof (+(Val2)) > sizeof (double))		      \
+     (__extension__ ((sizeof ((Val1) + (Val2)) > sizeof (double)	      \
 		      && __builtin_classify_type ((Val1) + (Val2)) == 8)      \
 		     ? __TGMATH_F128 ((Val1) + (Val2), Fct, (Val1, Val2))     \
 		     __tgml(Fct) (Val1, Val2)				      \
@@ -183,8 +180,7 @@
 		     : Fct##f (Val1, Val2)))
 
 # define __TGMATH_TERNARY_FIRST_SECOND_REAL_ONLY(Val1, Val2, Val3, Fct) \
-     (__extension__ (((sizeof (+(Val1)) > sizeof (double)		      \
-		       || sizeof (+(Val2)) > sizeof (double))		      \
+     (__extension__ ((sizeof ((Val1) + (Val2)) > sizeof (double)	      \
 		      && __builtin_classify_type ((Val1) + (Val2)) == 8)      \
 		     ? __TGMATH_F128 ((Val1) + (Val2),			      \
 				      (__typeof				      \
@@ -206,9 +202,7 @@
 		       Fct##f (Val1, Val2, Val3)))
 
 # define __TGMATH_TERNARY_REAL_ONLY(Val1, Val2, Val3, Fct) \
-     (__extension__ (((sizeof (+(Val1)) > sizeof (double)		      \
-		       || sizeof (+(Val2)) > sizeof (double)		      \
-		       || sizeof (+(Val3)) > sizeof (double))		      \
+     (__extension__ ((sizeof ((Val1) + (Val2) + (Val3)) > sizeof (double)     \
 		      && __builtin_classify_type ((Val1) + (Val2) + (Val3))   \
 			 == 8)						      \
 		     ? __TGMATH_F128 ((Val1) + (Val2) + (Val3),		      \
@@ -312,8 +306,8 @@
 /* XXX This definition has to be changed as soon as the compiler understands
    the imaginary keyword.  */
 # define __TGMATH_BINARY_REAL_IMAG(Val1, Val2, Fct, Cfct) \
-     (__extension__ (((sizeof (+__real__ (Val1)) > sizeof (double)	      \
-		       || sizeof (+__real__ (Val2)) > sizeof (double))	      \
+     (__extension__ ((sizeof (__real__ (Val1)				      \
+			      + __real__ (Val2)) > sizeof (double)	      \
 		      && __builtin_classify_type (__real__ (Val1)	      \
 						  + __real__ (Val2)) == 8)    \
 		     ? __TGMATH_CF128 ((Val1) + (Val2),			      \

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

Summary of changes:
 ChangeLog                |   13 +++++++++++++
 math/gen-tgmath-tests.py |    4 ++++
 math/tgmath.h            |   20 +++++++-------------
 3 files changed, 24 insertions(+), 13 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]