public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] PR libstdc++/84654 Do not use __float128 if it is disabled by the compiler
@ 2018-03-01 18:47 Tulio Magno Quites Machado Filho
  2018-03-01 18:54 ` Marc Glisse
  2018-03-01 19:10 ` [PATCH] " Jakub Jelinek
  0 siblings, 2 replies; 10+ messages in thread
From: Tulio Magno Quites Machado Filho @ 2018-03-01 18:47 UTC (permalink / raw)
  To: libstdc++, gcc-patches; +Cc: wschmidt, segher

In order to use the __float128 in C++ it's necessary to check if
it is supported in libstdc++ (i.e. via _GLIBCXX_USE_FLOAT128) and if the
compiler enabled its support too, e.g. -mfloat128 or -mno-float128.

2018-03-01 Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>

	PR libstdc++/84654
	* include/bits/std_abs.h: Avoid to use __float128 when the
	compiler disabled it.
	* include/std/type_traits: Likewise.
---
 libstdc++-v3/include/bits/std_abs.h  | 3 ++-
 libstdc++-v3/include/std/type_traits | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/libstdc++-v3/include/bits/std_abs.h b/libstdc++-v3/include/bits/std_abs.h
index 6e4551d..3ad1c2b 100644
--- a/libstdc++-v3/include/bits/std_abs.h
+++ b/libstdc++-v3/include/bits/std_abs.h
@@ -96,7 +96,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   abs(__GLIBCXX_TYPE_INT_N_3 __x) { return __x >= 0 ? __x : -__x; }
 #endif
 
-#if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_FLOAT128)
+#if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_FLOAT128) \
+    && defined(__FLOAT128__)
   inline _GLIBCXX_CONSTEXPR
   __float128
   abs(__float128 __x)
diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits
index 711d6c5..4e2e4f7 100644
--- a/libstdc++-v3/include/std/type_traits
+++ b/libstdc++-v3/include/std/type_traits
@@ -342,7 +342,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     struct __is_floating_point_helper<long double>
     : public true_type { };
 
-#if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_FLOAT128)
+#if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_FLOAT128) \
+    && defined(__FLOAT128__)
   template<>
     struct __is_floating_point_helper<__float128>
     : public true_type { };
-- 
2.9.5

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-05-07 20:03 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-01 18:47 [PATCH] PR libstdc++/84654 Do not use __float128 if it is disabled by the compiler Tulio Magno Quites Machado Filho
2018-03-01 18:54 ` Marc Glisse
2018-03-01 22:04   ` Jonathan Wakely
2018-03-12 19:02     ` [PATCHv2] " Tulio Magno Quites Machado Filho
2018-03-26 15:23       ` Tulio Magno Quites Machado Filho
2018-05-01 14:34       ` Jonathan Wakely
2018-05-07 20:03         ` Jonathan Wakely
2018-03-01 19:10 ` [PATCH] " Jakub Jelinek
2018-03-01 20:52   ` Jakub Jelinek
2018-03-01 20:56     ` Marc Glisse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).