aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--math/math.h8
2 files changed, 13 insertions, 1 deletions
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