diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2021-10-07 18:28:04 +0100 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2021-10-07 18:35:16 +0100 |
commit | 0e90799071ee78f712f3b58fca7000bc0a258ade (patch) | |
tree | 22a9bd96ed70f44d168c9231872161aef3726c6d | |
parent | 561078480ffb5adb68577276c6b23e4ee7b39272 (diff) | |
download | gcc-0e90799071ee78f712f3b58fca7000bc0a258ade.zip gcc-0e90799071ee78f712f3b58fca7000bc0a258ade.tar.gz gcc-0e90799071ee78f712f3b58fca7000bc0a258ade.tar.bz2 |
libstdc++: Avoid use of hardware interference non-constant [PR102377]
libstdc++-v3/ChangeLog:
PR libstdc++/102377
* include/bits/atomic_wait.h (__waiter_pool_base:_S_align):
Hardcode to 64 instead of using non-constant constant.
-rw-r--r-- | libstdc++-v3/include/bits/atomic_wait.h | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/libstdc++-v3/include/bits/atomic_wait.h b/libstdc++-v3/include/bits/atomic_wait.h index 35c9264..2ac07cc 100644 --- a/libstdc++-v3/include/bits/atomic_wait.h +++ b/libstdc++-v3/include/bits/atomic_wait.h @@ -190,11 +190,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION struct __waiter_pool_base { -#ifdef __cpp_lib_hardware_interference_size - static constexpr auto _S_align = hardware_destructive_interference_size; -#else - static constexpr auto _S_align = 64; -#endif + // Don't use std::hardware_destructive_interference_size here because we + // don't want the layout of library types to depend on compiler options. + static constexpr auto _S_align = 64; alignas(_S_align) __platform_wait_t _M_wait = 0; |