From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 6A520385840C for ; Thu, 7 Oct 2021 18:00:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6A520385840C Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-122-_vunax3RN_-F-Hz01A75iw-1; Thu, 07 Oct 2021 14:00:13 -0400 X-MC-Unique: _vunax3RN_-F-Hz01A75iw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 718D58C6B3E; Thu, 7 Oct 2021 17:39:52 +0000 (UTC) Received: from localhost (unknown [10.33.37.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id 21B1C60622; Thu, 7 Oct 2021 17:39:51 +0000 (UTC) Date: Thu, 7 Oct 2021 18:39:51 +0100 From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Cc: Thomas Rodgers Subject: [committed] libstdc++: Avoid use of hardware interference non-constant [PR102377] Message-ID: MIME-Version: 1.0 X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/mixed; boundary="HQxWxGzoI+RJns7C" Content-Disposition: inline X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2021 18:00:15 -0000 --HQxWxGzoI+RJns7C Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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. Tested x86_64-linux. Committed to trunk. --HQxWxGzoI+RJns7C Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="patch.txt" commit 0e90799071ee78f712f3b58fca7000bc0a258ade Author: Jonathan Wakely Date: Thu Oct 7 18:28:04 2021 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 --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; --HQxWxGzoI+RJns7C--