From patchwork Wed Jun 9 20:52:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Rodgers X-Patchwork-Id: 1490085 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (4096-bit key; secure) header.d=kolabnow.com header.i=@kolabnow.com header.a=rsa-sha256 header.s=dkim20160331 header.b=CMnn+qkD; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G0fTH48Cxz9s5R for ; Thu, 10 Jun 2021 06:53:22 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8D2DE39A0441 for ; Wed, 9 Jun 2021 20:53:19 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx.kolabnow.com (mx.kolabnow.com [95.128.36.41]) by sourceware.org (Postfix) with ESMTPS id 6AEB139A0004; Wed, 9 Jun 2021 20:52:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6AEB139A0004 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=appliantology.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=appliantology.com Received: from localhost (unknown [127.0.0.1]) by ext-mx-out003.mykolab.com (Postfix) with ESMTP id 75EAA403CF; Wed, 9 Jun 2021 22:52:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= content-transfer-encoding:mime-version:message-id:date:date :subject:subject:from:from:received:received:received; s= dkim20160331; t=1623271974; x=1625086375; bh=1sybg/VA11zzjBLlgc9 jIsFeS4+ab0oQSNPGU4gpREM=; b=CMnn+qkDCFJvzkRwdTis7PEMLc5tc2dCdEF mR5WDOz8cgnVaOXQ7+ckTZTfF0fInQ8aIUar79lLWw7TqkPUeyhtSBZxaBBYBWhj qDDYDHXcYSaoeP/AWfhqNaqhI39/tzfit2nkkn0zKOcEWluH5SbwpDJOKkLUtwaW n5xA60aHRFeIptS5EzhdxjRcojipE3ms7oXzTb1bszsNVFle1Y2lH1ye1E8BkfKh iIavyVJde/lklEmcjr4hkM+9qmwYUo+SdCMkVh3oPqLQWnILuxPnWasDu/xE/9GO d3w0qze4LJBRxATRqjdqNWPHqBTQcWbmuNN6AjnNq5Z+2cWgyLlUzmCsiJjRTF4S V2FL+i14D99UFVN925xd0mb06de8szwJ3HEvSwAi+VHY+kr9fM+kgkXSDCm8Mi2u l+u4FfjacnE2CCAilZ/PsyeK6zxn6B1Bcj9IGnubFo4DXuJ30BD6N322WwwYQ68x aK8L8+peVtmHE2EpQPl+9uO5xXgmCL/xA4KsWsJDSxF1uMAp6/1FOdjJ7Gi9zh6N n6ea4e5tLH8dqv2l2MW8UdYjhLnfj+Ppk7ydYKBkE7aSdkJxPGlHsSGn+c9D47he QMsnrNVM8IqLZI8O+lfhS/b+jG5mMTybljbGvaGEojSAyRwJDcS+q3ebVoHC70zs b9GRfByM= X-Virus-Scanned: amavisd-new at mykolab.com X-Spam-Score: -1.9 X-Spam-Level: X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.2 Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out003.mykolab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nos2zzDEiU3h; Wed, 9 Jun 2021 22:52:54 +0200 (CEST) Received: from int-mx002.mykolab.com (unknown [10.9.13.2]) by ext-mx-out003.mykolab.com (Postfix) with ESMTPS id D8D7F40194; Wed, 9 Jun 2021 22:52:53 +0200 (CEST) Received: from ext-subm001.mykolab.com (unknown [10.9.6.1]) by int-mx002.mykolab.com (Postfix) with ESMTPS id 46BC14B56; Wed, 9 Jun 2021 22:52:50 +0200 (CEST) From: Thomas Rodgers To: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org Subject: [committed] libstdc++: Only support atomic_ref::wait tests which are always lockfree Date: Wed, 9 Jun 2021 13:52:36 -0700 Message-Id: <20210609205236.1323202-1-rodgert@appliantology.com> MIME-Version: 1.0 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: trodgers@redhat.com Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Fixes a regression on arm32 targets. libstdc++/ChangeLog: * testsuite/29_atomics/atomic_ref/wait_notify.cc: Guard test logic with constexpr check for is_always_lock_free. As discussed on IRC. Tested x86_64-pc-linux-gnu, committed to master, backported to releases/gcc-11. --- .../29_atomics/atomic_ref/wait_notify.cc | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_ref/wait_notify.cc b/libstdc++-v3/testsuite/29_atomics/atomic_ref/wait_notify.cc index 2500dddf884..c21c3a11ab5 100644 --- a/libstdc++-v3/testsuite/29_atomics/atomic_ref/wait_notify.cc +++ b/libstdc++-v3/testsuite/29_atomics/atomic_ref/wait_notify.cc @@ -30,17 +30,20 @@ template void test (S va, S vb) { - S aa{ va }; - S bb{ vb }; - std::atomic_ref a{ aa }; - a.wait(bb); - std::thread t([&] + if constexpr (std::atomic_ref::is_always_lock_free) { - a.store(bb); - a.notify_one(); - }); - a.wait(aa); - t.join(); + S aa{ va }; + S bb{ vb }; + std::atomic_ref a{ aa }; + a.wait(bb); + std::thread t([&] + { + a.store(bb); + a.notify_one(); + }); + a.wait(aa); + t.join(); + } } int