diff options
author | Marshall Clow <mclow.lists@gmail.com> | 2019-04-02 14:46:36 +0000 |
---|---|---|
committer | Marshall Clow <mclow.lists@gmail.com> | 2019-04-02 14:46:36 +0000 |
commit | 3bf63cf3b366d3a57cf5cbad4112a6abf6c0c3b1 (patch) | |
tree | 4bfbb22a43564a1baf52f239d3e3602537a05cc8 | |
parent | 709ee69d0a3d6b1025a90117866a6b3bbe0397d5 (diff) | |
download | bcm5719-llvm-3bf63cf3b366d3a57cf5cbad4112a6abf6c0c3b1.tar.gz bcm5719-llvm-3bf63cf3b366d3a57cf5cbad4112a6abf6c0c3b1.zip |
Special case some duration arithmetic for GCC and PPC because their long double constant folding is broken. Fixes PR#39696.
llvm-svn: 357478
-rw-r--r-- | libcxx/include/thread | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libcxx/include/thread b/libcxx/include/thread index df06ff70f8e..400459ae7f3 100644 --- a/libcxx/include/thread +++ b/libcxx/include/thread @@ -434,7 +434,12 @@ sleep_for(const chrono::duration<_Rep, _Period>& __d) using namespace chrono; if (__d > duration<_Rep, _Period>::zero()) { +#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 = duration<long double>(ULLONG_MAX/1000000000ULL) ; +#else _LIBCPP_CONSTEXPR duration<long double> _Max = nanoseconds::max(); +#endif nanoseconds __ns; if (__d < _Max) { |