[libcxx-commits] [libcxx] d9a42ec - [libc++] Work around gcc/Power9 bug in `include/thread`

Joel E. Denny via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jun 10 09:43:04 PDT 2020


Author: Joel E. Denny
Date: 2020-06-10T12:40:43-04:00
New Revision: d9a42ec98adcb1ebc0c3837715df4e5a50c7ccc0

URL: https://github.com/llvm/llvm-project/commit/d9a42ec98adcb1ebc0c3837715df4e5a50c7ccc0
DIFF: https://github.com/llvm/llvm-project/commit/d9a42ec98adcb1ebc0c3837715df4e5a50c7ccc0.diff

LOG: [libc++] Work around gcc/Power9 bug in `include/thread`

This fixes PR39696, which breaks the libcxx build with gcc (I tested
7.5.0) on Power9.  This fix was suggested at

https://bugs.llvm.org/show_bug.cgi?id=39696#c38

but never applied.  It just reverts 0583d9ea8d5e, which reverses
components of the original fix in 3bf63cf3b366, which is correct.

Fixes https://llvm.org/PR39696

Reviewed By: ldionne

Differential Revision: https://reviews.llvm.org/D81438

Added: 
    

Modified: 
    libcxx/include/thread

Removed: 
    


################################################################################
diff  --git a/libcxx/include/thread b/libcxx/include/thread
index 22aa4f201295..6eff1800acdb 100644
--- a/libcxx/include/thread
+++ b/libcxx/include/thread
@@ -365,9 +365,9 @@ sleep_for(const chrono::duration<_Rep, _Period>& __d)
     {
 #if defined(_LIBCPP_COMPILER_GCC) && (__powerpc__ || __POWERPC__)
     //  GCC's long double const folding is incomplete for IBM128 long doubles.
-        _LIBCPP_CONSTEXPR duration<long double> _Max = nanoseconds::max();
-#else
         _LIBCPP_CONSTEXPR duration<long double> _Max = duration<long double>(ULLONG_MAX/1000000000ULL) ;
+#else
+        _LIBCPP_CONSTEXPR duration<long double> _Max = nanoseconds::max();
 #endif
         nanoseconds __ns;
         if (__d < _Max)


        


More information about the libcxx-commits mailing list