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-383-gc5c4a62


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  c5c4a626098ec884b8527356abdf2a4bb7b6bf27 (commit)
      from  23947846658fd41875381c0bcc05b319c3c7bde4 (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=c5c4a626098ec884b8527356abdf2a4bb7b6bf27

commit c5c4a626098ec884b8527356abdf2a4bb7b6bf27
Author: Gabriel F. T. Gomes <gabriel@inconstante.eti.br>
Date:   Wed Sep 20 15:10:26 2017 -0300

    Let fpclassify use the builtin when optimizing for size in C++ mode (bug 22146)
    
    When optimization for size is on (-Os), fpclassify does not use the
    type-generic __builtin_fpclassify builtin, instead it uses __MATH_TG.
    However, when library support for float128 is available, __MATH_TG uses
    __builtin_types_compatible_p, which is not available in C++ mode.
    
    On the other hand, libstdc++ undefines (in cmath) many macros from
    math.h, including fpclassify, so that it can provide its own functions.
    However, during its configure tests, libstdc++ just tests for the
    availability of the macros (it does not undefine them, nor does it
    provide its own functions).
    
    Finally, when libstdc++ is configured with optimization for size
    enabled, its configure tests include math.h and get the definition of
    fpclassify that uses __MATH_TG (and __builtin_types_compatible_p).
    Since libstdc++ does not undefine the macros during its configure tests,
    they fail.
    
    This patch lets fpclassify use the builtin in C++ mode, even when
    optimization for size is on.  This allows the configure test in
    libstdc++ to work.
    
    Tested for powerpc64le and x86_64.
    
    	[BZ #22146]
    	math/math.h: Let fpclassify use the builtin in C++ mode, even
    	when optimazing for size.

diff --git a/ChangeLog b/ChangeLog
index e4f304e..d69bf1f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-09-22  Gabriel F. T. Gomes  <gabriel@inconstante.eti.br>
+
+	[BZ #22146]
+	math/math.h: Let fpclassify use the builtin in C++ mode, even
+	when optimazing for size.
+
 2017-09-22  Joseph Myers  <joseph@codesourcery.com>
 
 	* csu/Makefile (generated): Do not add version-info.h.
diff --git a/math/math.h b/math/math.h
index 6c2ad97..c6c289d 100644
--- a/math/math.h
+++ b/math/math.h
@@ -432,7 +432,13 @@ enum
 
 /* Return number of classification appropriate for X.  */
 # if __GNUC_PREREQ (4,4) && !defined __SUPPORT_SNAN__			      \
-     && !defined __OPTIMIZE_SIZE__
+     && (!defined __OPTIMIZE_SIZE__ || defined __cplusplus)
+     /* The check for __cplusplus allows the use of the builtin, even
+	when optimization for size is on.  This is provided for
+	libstdc++, only to let its configure test work when it is built
+	with -Os.  No further use of this definition of fpclassify is
+	expected in C++ mode, since libstdc++ provides its own version
+	of fpclassify in cmath (which undefines fpclassify).  */
 #  define fpclassify(x) __builtin_fpclassify (FP_NAN, FP_INFINITE,	      \
      FP_NORMAL, FP_SUBNORMAL, FP_ZERO, x)
 # else

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

Summary of changes:
 ChangeLog   |    6 ++++++
 math/math.h |    8 +++++++-
 2 files changed, 13 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]