From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 387B6385840C; Thu, 7 Oct 2021 17:39:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 387B6385840C MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r12-4234] libstdc++: Avoid use of hardware interference non-constant [PR102377] X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: 561078480ffb5adb68577276c6b23e4ee7b39272 X-Git-Newrev: 0e90799071ee78f712f3b58fca7000bc0a258ade Message-Id: <20211007173919.387B6385840C@sourceware.org> Date: Thu, 7 Oct 2021 17:39:19 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2021 17:39:19 -0000 https://gcc.gnu.org/g:0e90799071ee78f712f3b58fca7000bc0a258ade commit r12-4234-g0e90799071ee78f712f3b58fca7000bc0a258ade Author: Jonathan Wakely Date: Thu Oct 7 18:28:04 2021 +0100 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. Diff: --- libstdc++-v3/include/bits/atomic_wait.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/libstdc++-v3/include/bits/atomic_wait.h b/libstdc++-v3/include/bits/atomic_wait.h index 35c92644146..2ac07ccd05e 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;