From patchwork Wed Oct 4 17:04:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans-Peter Nilsson X-Patchwork-Id: 148526 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp342319vqb; Wed, 4 Oct 2023 12:00:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFIa0j7ITjr4tNbWRsB9mbTHPXBzikzNYDGucxyXzK3vafXtQbdakdxTlNhoczCdnm9bQL4 X-Received: by 2002:aa7:d451:0:b0:52f:b5c8:fa6a with SMTP id q17-20020aa7d451000000b0052fb5c8fa6amr2823948edr.20.1696446056262; Wed, 04 Oct 2023 12:00:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1696446056; cv=pass; d=google.com; s=arc-20160816; b=DUMca72EtWUrLSXWiaV3UHJEqZYID5Ui7VVsZD/Rr8esMWVC0+n2HNzUtqJe3+skur XzlAH+zg0Yjd77zSDjiFKnZ3hQYSCjXv1j3oFJRuPadJOQlMA/MJrxvHAeDP97F3rkZR z5rq7dKBL4FEpPEvHOsGNGaXwgR6OzUtHmEpyHHqFxBiBtvUVQiqzxQ6Rd0M8yFr3xPr dqktNGJV1jJapqsG/S+sliTeBiNg2htgIY7NBpjoGH9Ry9WGUkVI5DGaOyWz8S0JHY6d hkTHlfgC0NT9Y7hzL4HzHc0Z101etWLz/3A0VcwCjeoR2FLG5yCqz2YksjbI0U50uH5S XaEg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:date:message-id:references :content-transfer-encoding:mime-version:subject:in-reply-to:cc:to :from:dkim-signature:dmarc-filter:delivered-to; bh=tkhbHM3unlyOEBdJqYQPbJgXbjbwrDVSrtMdHr3ZnUo=; fh=AKfNtHGieTaUQwRqhtuKEF5if3WVqTGfwxCWwW3MSPg=; b=b1R1z4AAYNp8YDyBMb9F62LLV3a3P7PiHtC6lmALgEWacdNY7uekeWqZ5PKAKZtzHc 3sElgsbZtRq1WQG4aiLtbZiC3NVBTQFseN6rwlee+AEWyQElKTDBF6uNXHMnaD7T6QVL SH0pZ1cOhGT8AnuqM8JXREk6gfeLi12XjYlsfFjMdPSx8r1oQGxezhWAcCWBcPiLaQiw mNWAFEv6Rnr4SxtnLHgjN+jNHAzWncdV8Hi8S5g5dW3JpZO3ZtTNjv5hP04jDokvkMdD 0Mj+PNiDUSZuWgXitc5d/77f+AQKoU3zjjmbfBaa2DSpYwbjP/4ljQEKS3xp8lXu2LPe IcTw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@axis.com header.s=selector1 header.b=AywYoUji; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=axis.com Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id p23-20020aa7d317000000b00532db0a52b8si173619edq.340.2023.10.04.12.00.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 12:00:56 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@axis.com header.s=selector1 header.b=AywYoUji; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=axis.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 73A693882AFD for ; Wed, 4 Oct 2023 17:05:42 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2053.outbound.protection.outlook.com [40.107.21.53]) by sourceware.org (Postfix) with ESMTPS id 117593858C39; Wed, 4 Oct 2023 17:04:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 117593858C39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=axis.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=axis.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JZ+ZICmnu2Q+PWRf+tfpoqrQvh4/f5zUqhKPZRzX8WJR4yrVDDdNlS1yC5VOq6gBf6nMHAyirwJcMRBHEdCIbDZWqMeuB+rkdukYqoEji2fxFhG/Z39M3RLolWU3HW1HJsaDI92GpWNd8MwvMEx6B7gt95EE5TWsv/OAmP5IMfrGU0CyUz5Mw/SGyO011aqohta7j6OaFrhdI1Frank5PJs47NnfS2SAwl+3X5ctx3UITlBoAdraJTS78JR4VOW3hf5k0HBuwIhPKW6NqGP5DOEaAZf3t1Bv6ivWA95r/a2T6r5MIJlfGJlhgqA5G7LYos6gow0SYF6TiEcxMVzdug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=tkhbHM3unlyOEBdJqYQPbJgXbjbwrDVSrtMdHr3ZnUo=; b=VVbQuKldxWv2hJnJnXwmi3AxJmQVwoN39p2Egu+1j4WAtYCYbKPmsQ5jS/kWqFzzMIeqjWdCyfwvrf8II9QOh8qITas35KXPR/MED5kngj8Fqn574enDvt0H7vtXz5dYjBzSMngnpqKgLvXX41JvjpRe7DhkixUqf+RqdQwh0GWT15FThW8gnQN4yuTkaUCruhjrqt5jWWBOoD4uMk3Zy+6uYq6dCUWa9zjAchmkjkthIgM4TqNij5zW65b6I1VF7AqfDAZv3xr8IDUJ+Q7Nb0M0qxfNjnHA7uqcmwHEZ5N1vmqT6LZX694+QVftozBvo53cDGsKpHX4n0LXu8K6zw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 195.60.68.100) smtp.rcpttodomain=gcc.gnu.org smtp.mailfrom=axis.com; dmarc=fail (p=none sp=none pct=100) action=none header.from=axis.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tkhbHM3unlyOEBdJqYQPbJgXbjbwrDVSrtMdHr3ZnUo=; b=AywYoUjimrlNmqisAKGGEIopchynrXW0G+rmPmPCzkQG5FDlgWomUCYnJAYwof3+xg0EkKXIdQx6jZG7dG3CGCnETQxgYow7CoA/tbkLcjY0VCIyH20GYGWKAwq0XxvVZZ9RIbylvlTvb0jafnbHjicYt8Cq73sfpVT2OgJpYdc= Received: from DB9PR01CA0017.eurprd01.prod.exchangelabs.com (2603:10a6:10:1d8::22) by PAWPR02MB9030.eurprd02.prod.outlook.com (2603:10a6:102:336::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.28; Wed, 4 Oct 2023 17:04:56 +0000 Received: from DU6PEPF00009529.eurprd02.prod.outlook.com (2603:10a6:10:1d8:cafe::9d) by DB9PR01CA0017.outlook.office365.com (2603:10a6:10:1d8::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.33 via Frontend Transport; Wed, 4 Oct 2023 17:04:56 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 195.60.68.100) smtp.mailfrom=axis.com; dkim=none (message not signed) header.d=none;dmarc=fail action=none header.from=axis.com; Received-SPF: Fail (protection.outlook.com: domain of axis.com does not designate 195.60.68.100 as permitted sender) receiver=protection.outlook.com; client-ip=195.60.68.100; helo=mail.axis.com; Received: from mail.axis.com (195.60.68.100) by DU6PEPF00009529.mail.protection.outlook.com (10.167.8.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6838.14 via Frontend Transport; Wed, 4 Oct 2023 17:04:56 +0000 Received: from se-mail01w.axis.com (10.20.40.7) by se-mail02w.axis.com (10.20.40.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Wed, 4 Oct 2023 19:04:55 +0200 Received: from se-intmail01x.se.axis.com (10.0.5.60) by se-mail01w.axis.com (10.20.40.7) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Wed, 4 Oct 2023 19:04:55 +0200 Received: from pchp3.se.axis.com (pchp3.se.axis.com [10.88.21.53]) by se-intmail01x.se.axis.com (Postfix) with ESMTP id 7C630149D; Wed, 4 Oct 2023 19:04:55 +0200 (CEST) Received: by pchp3.se.axis.com (Postfix, from userid 171) id 76C1A2043D; Wed, 4 Oct 2023 19:04:55 +0200 (CEST) From: Hans-Peter Nilsson To: , CC: , In-Reply-To: <20231004151528.2ADB12043D@pchp3.se.axis.com> (message from Hans-Peter Nilsson on Wed, 4 Oct 2023 17:15:28 +0200) Subject: [PATCH v2 1/2] testsuite: Add dg-require-atomic-cmpxchg-word MIME-Version: 1.0 References: <20230926143439.B589920431@pchp3.se.axis.com> <20231004031136.8B8BA2042A@pchp3.se.axis.com> <20231004151528.2ADB12043D@pchp3.se.axis.com> Message-ID: <20231004170455.76C1A2043D@pchp3.se.axis.com> Date: Wed, 4 Oct 2023 19:04:55 +0200 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU6PEPF00009529:EE_|PAWPR02MB9030:EE_ X-MS-Office365-Filtering-Correlation-Id: 733ea00a-205b-4abb-c74d-08dbc4fc08cb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GV0e54X6kB1S0biwm4ut00hY/B/iaxnTDHE0D5RUzrAPImCRWVApiejd/6JbJBMrJLOYgO98z38GptL1MbrEhUjZntuDndHuJFry42WDRu56Q0jb2ux7rH9C4NKWQsBFMx78pyPaYYGyaP2QeiyLQPWiFseEKwHjaL767gHHqy9DtMKjL4YPGNkOmKpYARg9NBrRof26e015Pp8kyU8EBaCWnxwb/WIC6M0tdjpmRI98OfeD5W9M+cLUfsaSoDJtVT2x42iGWntmrB2kclkZtb4QbsVIIkxeGWZqX6ElVbfiR3Nu98k0EWz/o1jRkKCB/AWVO/99ZzaQ/1+dKVAhWmNFzDCaQxjioQ6jFLN0T93CJuaZZGT916l+Q+9dJeCEr5M7P7Ogepy8qncxJRwpEM/csDSUbsqxD/XJ7laf7Ve+AoOYYby/gNQbhBRAOR2XLYnJl/xxoTeKfPwE+ewglabBkyOq9A+HuIwx6JkNJj6uRtiLtuFKx8gha+teZocQFKt52YHwd7XR1IECsEtjQaaM9Z/YeigBoYqkVMKsmrm5E6PHtu6P0nkpkB9mm2QvrWs2xqBe9g3UXE38bV44F8fZo9CkI/i1qeWdeBQmb/UvJK7B0l7cMiq75KP14W3SLSeIoTAmgvJKNV0NWtVWaI2jJf/TMlwFYBJXW8r8cbb7nU0rRsQxDf+djkkJZTPLJDMBM+TwVAP2JIFhsl2exkRTtI8mbo1cW3KF6lFcAm2F7EdXVYshn4ybtus11jWCm6Wo45ywFhPCVcG/qHJSJw== X-Forefront-Antispam-Report: CIP:195.60.68.100; CTRY:SE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.axis.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(4636009)(39860400002)(346002)(376002)(136003)(396003)(230922051799003)(451199024)(1800799009)(82310400011)(186009)(64100799003)(46966006)(36840700001)(40470700004)(70206006)(26005)(2906002)(110136005)(70586007)(4326008)(5660300002)(8676002)(42186006)(54906003)(41300700001)(8936002)(478600001)(36860700001)(6266002)(336012)(316002)(426003)(1076003)(47076005)(83380400001)(40460700003)(356005)(81166007)(82740400003)(40480700001)(33656002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2023 17:04:56.0651 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 733ea00a-205b-4abb-c74d-08dbc4fc08cb X-MS-Exchange-CrossTenant-Id: 78703d3c-b907-432f-b066-88f7af9ca3af X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=78703d3c-b907-432f-b066-88f7af9ca3af; Ip=[195.60.68.100]; Helo=[mail.axis.com] X-MS-Exchange-CrossTenant-AuthSource: DU6PEPF00009529.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR02MB9030 X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852619618649407 X-GMAIL-MSGID: 1778852619618649407 > From: Hans-Peter Nilsson > Date: Wed, 4 Oct 2023 17:15:28 +0200 > New version coming up. Using pointer-sized int instead of int, __atomic_compare_exchange instead of __atomic_exchange, renamed to atomic-cmpxchg-word from atomic-exchange, and updating a comment that already seemed reasonably well placed. Tested as with v1 1/2. Ok to commit? -- >8 -- Some targets (armv6-m) support inline atomic load and store, i.e. dg-require-thread-fence matches, but not atomic operations like compare and exchange. This directive can be used to replace uses of dg-require-thread-fence where an atomic operation is actually used. * testsuite/lib/dg-options.exp (dg-require-atomic-cmpxchg-word): New proc. * testsuite/lib/libstdc++.exp (check_v3_target_atomic_cmpxchg_word): Ditto. --- libstdc++-v3/testsuite/lib/dg-options.exp | 9 ++++++ libstdc++-v3/testsuite/lib/libstdc++.exp | 37 +++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/libstdc++-v3/testsuite/lib/dg-options.exp b/libstdc++-v3/testsuite/lib/dg-options.exp index 84ad0c65330b..850442b6b7c1 100644 --- a/libstdc++-v3/testsuite/lib/dg-options.exp +++ b/libstdc++-v3/testsuite/lib/dg-options.exp @@ -133,6 +133,15 @@ proc dg-require-thread-fence { args } { return } +proc dg-require-atomic-cmpxchg-word { args } { + if { ![ check_v3_target_atomic_cmpxchg_word ] } { + upvar dg-do-what dg-do-what + set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"] + return + } + return +} + proc dg-require-atomic-builtins { args } { if { ![ check_v3_target_atomic_builtins ] } { upvar dg-do-what dg-do-what diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp index 608056e5068e..4bedb36dc6f9 100644 --- a/libstdc++-v3/testsuite/lib/libstdc++.exp +++ b/libstdc++-v3/testsuite/lib/libstdc++.exp @@ -1221,6 +1221,43 @@ proc check_v3_target_thread_fence { } { }] } +proc check_v3_target_atomic_cmpxchg_word { } { + return [check_v3_target_prop_cached et_atomic_cmpxchg_word { + global cxxflags + global DEFAULT_CXXFLAGS + + # Set up and link a C++11 test program that depends on + # atomic-compare-exchange being available for a pointer-sized + # integer. It should be sufficient as gcc can derive all + # other operations when a target implements this operation. + set src atomic_cmpxchg_word[pid].cc + + set f [open $src "w"] + puts $f " + __UINTPTR_TYPE__ i, j, k; + int main() { + __atomic_compare_exchange (&i, &j, &k, 1, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); + return 0; + }" + close $f + + set cxxflags_saved $cxxflags + set cxxflags "$cxxflags $DEFAULT_CXXFLAGS -Werror -std=gnu++11" + + set lines [v3_target_compile $src /dev/null executable ""] + set cxxflags $cxxflags_saved + file delete $src + + if [string match "" $lines] { + # No error message, linking succeeded. + return 1 + } else { + verbose "check_v3_target_atomic_cmpxchg_word: compilation failed" 2 + return 0 + } + }] +} + # Return 1 if atomics_bool and atomic_int are always lock-free, 0 otherwise. proc check_v3_target_atomic_builtins { } { return [check_v3_target_prop_cached et_atomic_builtins { From patchwork Wed Oct 4 17:08:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans-Peter Nilsson X-Patchwork-Id: 148465 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp337836vqb; Wed, 4 Oct 2023 11:51:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFoukedg5X2onzgo7xIppvsHSfb2khC8GX+RTiypSiHuv73+6B/KlTH8EtAuqa0Tf2lgp3D X-Received: by 2002:a05:6402:890:b0:531:140f:335b with SMTP id e16-20020a056402089000b00531140f335bmr2922625edy.31.1696445460645; Wed, 04 Oct 2023 11:51:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1696445460; cv=pass; d=google.com; s=arc-20160816; b=eGA11GmB7lInQXNpdnIG957S+vd9QV4HnjHWBTIJ0Ez+I0UE2JV9K4Jyjj7AdgCKAu MLoWDj0YzCZ5NXC/1Lup7TmHk114jV0eTPkfl/iujgVQrLlBJ1LzajC6j4hQAY5zQlRe 2/0F52L9X9s7nyPmC2xXbQXyyw91lEqfg0h6KyjLhhyteg+HORbzW0bn6+bY1yCsXnkS +OlSMsF30rCsR9NvbHu7+N+vL2f1JgoDcn13t0pdxgf+htYd5tQC+MshOZn6++qy+tBP b3NdN+L0rq16k8Af3C1hBVd89Rm2Hz6UHb8noYAv5FqWZ/eLtzpC6zOZht2PiFTmlpBJ ocYQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:date:message-id:references :content-transfer-encoding:mime-version:subject:in-reply-to:cc:to :from:dkim-signature:dmarc-filter:delivered-to; bh=9oxyiGvx9opLmc4UT55hTvS/uTZKZw1M9F31viuQKKA=; fh=AKfNtHGieTaUQwRqhtuKEF5if3WVqTGfwxCWwW3MSPg=; b=iLqka5rjaw9rTqDj6Dt9tw/Ip5y2sS98RmkWlDf4Y2WtfvS8U3AFqfH4IDH9dXB6BQ YXPmLKXEnfEXVzaRakbngurXG3vbd8oLCSPX4Cc5XYszfThwSIoVA+Rs7Bfr05Kua9Pk U+hLXQZHRT8lHnnPBzbfYrpJluX2LS51fQ7pokPqJDz1TG+NlmzOgzNS315jn6pj/kgx CGKwJ8ncnGf1YL2+j6Gy6c1zZH98HUWd5plFZSy9xhngD+FwkV9YiOJi9yThSdOuIMDh 1lgcO/u1EYupgETZ0tDSNfEh/QF1fLL8IhhUKlNYkqU3mD3eny6QmLoUzeBeyvaFYj1L ofsQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@axis.com header.s=selector1 header.b=pUD3Fvpz; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=axis.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id q21-20020aa7da95000000b005305bc899basi156139eds.229.2023.10.04.11.51.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:51:00 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@axis.com header.s=selector1 header.b=pUD3Fvpz; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=axis.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 82CFA389942C for ; Wed, 4 Oct 2023 17:09:15 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2074.outbound.protection.outlook.com [40.107.8.74]) by sourceware.org (Postfix) with ESMTPS id 33C8A3858C5F; Wed, 4 Oct 2023 17:08:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 33C8A3858C5F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=axis.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=axis.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g0G31Kp7Oe8Vh4cGp5tgd++234ZkOl9fVjijNIkzPMKuPqfryfVTqnlSkBKryfVYMvACOCQ9uTIlOaA4Cgy39yB84VnJUSqww7s+g1DnGwDk8TxD9qxzvq8N0OJbCVy6ZihnqtKbvmnAhNcdDMTZ2VW2cDYKAuLnugVmlcdvU4R8iDDJJHmHdanByYReC66ZAwz3G1D90S8exsx2yfgsbjqU2sdNZb7AJkayeY5FKtHHZVWj+NLA4faXv4chbFrqpd1RgvIkhie+P7sJCb7OjubPIGyVlAzoslLNbUfaFXPkyTPZ3ChJBwl2iAUIe6hz3oHbASwjESNYNZpRuvJRcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=9oxyiGvx9opLmc4UT55hTvS/uTZKZw1M9F31viuQKKA=; b=fMb7uFFQRyJqFLvH5Gpez99waMefjn704501KOvsyl5ybps9ePjaPssn7bh7LpFOtZIpiqEHgSxD3AxxOzbTaMb5dp77oQe/w5QiFW+dQ6Q34pvdG1udc1Vxz6oLnWVfobINLVMyMn2gYldeoA/3FJc8E0H6iNSn/qzc8rl55ZDxYtVoz6rlksiISzD+sikaoI6j6LuP2QWNRvSShCmW3zfYxxWWXTj6dkq96qmsZkI8UMNErJckpxWYA4WjlWCq5y52XwKqpGi2tjizxSDwg06Pg3A2knh08x1cmTtYJC+/3SklowVDDAsQh8H0DTO+ny16I/K0KRKMb6O20eRejQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 195.60.68.100) smtp.rcpttodomain=gcc.gnu.org smtp.mailfrom=axis.com; dmarc=fail (p=none sp=none pct=100) action=none header.from=axis.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9oxyiGvx9opLmc4UT55hTvS/uTZKZw1M9F31viuQKKA=; b=pUD3FvpzwlE+ahmC7yNQYashUfyrV+QjUjpxkYqcBQVVETFs/Sg6UWBdrSaoehPFfDDSsbzJIP0KOpdzek6mittSp5N/y/llHc71KapAoMrSyhD2aOAFm/Cfu75Cj5lEiLZcsqsrHi5QMUYnrit0KdiwpwEt1Tt+wl3uz/kOVgM= Received: from AM7PR04CA0017.eurprd04.prod.outlook.com (2603:10a6:20b:110::27) by DU0PR02MB9194.eurprd02.prod.outlook.com (2603:10a6:10:466::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.33; Wed, 4 Oct 2023 17:08:17 +0000 Received: from AM3PEPF0000A78E.eurprd04.prod.outlook.com (2603:10a6:20b:110:cafe::3b) by AM7PR04CA0017.outlook.office365.com (2603:10a6:20b:110::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.26 via Frontend Transport; Wed, 4 Oct 2023 17:08:17 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 195.60.68.100) smtp.mailfrom=axis.com; dkim=none (message not signed) header.d=none;dmarc=fail action=none header.from=axis.com; Received-SPF: Fail (protection.outlook.com: domain of axis.com does not designate 195.60.68.100 as permitted sender) receiver=protection.outlook.com; client-ip=195.60.68.100; helo=mail.axis.com; Received: from mail.axis.com (195.60.68.100) by AM3PEPF0000A78E.mail.protection.outlook.com (10.167.16.117) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6838.14 via Frontend Transport; Wed, 4 Oct 2023 17:08:17 +0000 Received: from se-mail01w.axis.com (10.20.40.7) by se-mail01w.axis.com (10.20.40.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Wed, 4 Oct 2023 19:08:16 +0200 Received: from se-intmail02x.se.axis.com (10.0.5.60) by se-mail01w.axis.com (10.20.40.7) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Wed, 4 Oct 2023 19:08:16 +0200 Received: from pchp3.se.axis.com (pchp3.se.axis.com [10.88.21.53]) by se-intmail02x.se.axis.com (Postfix) with ESMTP id D0C4122E2; Wed, 4 Oct 2023 19:08:16 +0200 (CEST) Received: by pchp3.se.axis.com (Postfix, from userid 171) id CAD8D20424; Wed, 4 Oct 2023 19:08:16 +0200 (CEST) From: Hans-Peter Nilsson To: , CC: , In-Reply-To: <20231004151528.2ADB12043D@pchp3.se.axis.com> (message from Hans-Peter Nilsson on Wed, 4 Oct 2023 17:15:28 +0200) Subject: [PATCH v2 2/2] testsuite: Replace many dg-require-thread-fence with dg-require-atomic-cmpxchg-word MIME-Version: 1.0 References: <20230926143439.B589920431@pchp3.se.axis.com> <20231004031136.8B8BA2042A@pchp3.se.axis.com> <20231004151528.2ADB12043D@pchp3.se.axis.com> Message-ID: <20231004170816.CAD8D20424@pchp3.se.axis.com> Date: Wed, 4 Oct 2023 19:08:16 +0200 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM3PEPF0000A78E:EE_|DU0PR02MB9194:EE_ X-MS-Office365-Filtering-Correlation-Id: ed096f11-400c-44bf-06f1-08dbc4fc80a8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gcSTf3idPqIzCWDRYwIZ0T9fFv0LHQ50pPbzIFWzM33xyZu+8Uj6dETXBKw/ljvpX162SVgxbwwCPT5xBctyjuTBj9UuN+AfJ6eai/o56AvnUf1rcS1KcDeBXsRbZU+wzetnYK6q+wM5zzK3HjAzCJLI1LqMXviM39Ncn+2bACfs+YcZTgUVVXT0PHHencGkaq23UkLUJsedOWkowDVzLkbDMV2j3MuYPyYOOhJqA1SiONailhyXwM1Q7X7oKrnZrBm6Ah8LU43l0fZ30LemaamggoGqZfihABb0O+fsYoABO0q1/ongDHjKeZV/x8eKs0UDiGLjvM+1Yw6eJi0qucagVVjlnnhfeDV6RpsKv83HE7v7FfDdwIsi9qb+I38RTRtJ83pBnDqmgDrTbzC6PGOwhe3qdfmeFU5G5NKUHjdujbf1IA2hV8axRuI1RkkDkFjSsrEKJQqrUTGihJbX03b11Qb0RoJKvMkLtqQMiKsFauv1SAMxOdsFmNiaC3GPIHbTA/m+c9dbjvae4RWfOmhTneO8KESO7E/CLA0vUDFT+p3Ppv5MJgrosZVP/0sK+kL8r2G732b4xqmzPud4zdB93KONH1qaTk4fFKmJ5U/rBhluWIhRq2hKF1IMWOhm3xWzopGoq4dkSp7YfDO5KcN85QEgJrHm0HEaYeOH+7JQxXDiPGnicykUf/z8Iv7RWTljirO7FhBv19jHUC+30V/I2b44k6bgCGgVwAWcQYE7ppJHD603B4U2UaQHDVOe6kHJL6hTVeDxWU2f0WcK11FTGgllySJICeCYgVVqvTw= X-Forefront-Antispam-Report: CIP:195.60.68.100; CTRY:SE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.axis.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(4636009)(396003)(136003)(346002)(39860400002)(376002)(230922051799003)(64100799003)(82310400011)(186009)(451199024)(1800799009)(46966006)(40470700004)(36840700001)(110136005)(54906003)(70206006)(40480700001)(70586007)(316002)(36860700001)(42186006)(1076003)(41300700001)(40460700003)(426003)(336012)(2906002)(6266002)(83380400001)(33656002)(26005)(5660300002)(4326008)(8936002)(8676002)(81166007)(82740400003)(356005)(478600001)(47076005)(2004002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2023 17:08:17.2042 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ed096f11-400c-44bf-06f1-08dbc4fc80a8 X-MS-Exchange-CrossTenant-Id: 78703d3c-b907-432f-b066-88f7af9ca3af X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=78703d3c-b907-432f-b066-88f7af9ca3af; Ip=[195.60.68.100]; Helo=[mail.axis.com] X-MS-Exchange-CrossTenant-AuthSource: AM3PEPF0000A78E.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR02MB9194 X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, URIBL_BLACK autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778851995458003497 X-GMAIL-MSGID: 1778851995458003497 s/atomic-exchange/atomic-cmpxchg-word/g. Tested as v1. Ok to commit? -- >8 -- These tests actually use a form of atomic compare and exchange operation, not just atomic loading and storing. Some targets (not supported by e.g. libatomic) have atomic loading and storing, but not compare and exchange, yielding linker errors for missing library functions. This change is just for existing uses of dg-require-thread-fence. It does not fix any other tests that should also be gated on dg-require-atomic-cmpxchg-word. * testsuite/29_atomics/atomic/compare_exchange_padding.cc, testsuite/29_atomics/atomic_flag/clear/1.cc, testsuite/29_atomics/atomic_flag/cons/value_init.cc, testsuite/29_atomics/atomic_flag/test_and_set/explicit.cc, testsuite/29_atomics/atomic_flag/test_and_set/implicit.cc, testsuite/29_atomics/atomic_ref/compare_exchange_padding.cc, testsuite/29_atomics/atomic_ref/generic.cc, testsuite/29_atomics/atomic_ref/integral.cc, testsuite/29_atomics/atomic_ref/pointer.cc: Replace dg-require-thread-fence with dg-require-atomic-cmpxchg-word. --- .../testsuite/29_atomics/atomic/compare_exchange_padding.cc | 2 +- libstdc++-v3/testsuite/29_atomics/atomic_flag/clear/1.cc | 2 +- .../testsuite/29_atomics/atomic_flag/cons/value_init.cc | 2 +- .../testsuite/29_atomics/atomic_flag/test_and_set/explicit.cc | 2 +- .../testsuite/29_atomics/atomic_flag/test_and_set/implicit.cc | 2 +- .../testsuite/29_atomics/atomic_ref/compare_exchange_padding.cc | 2 +- libstdc++-v3/testsuite/29_atomics/atomic_ref/generic.cc | 2 +- libstdc++-v3/testsuite/29_atomics/atomic_ref/integral.cc | 2 +- libstdc++-v3/testsuite/29_atomics/atomic_ref/pointer.cc | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libstdc++-v3/testsuite/29_atomics/atomic/compare_exchange_padding.cc b/libstdc++-v3/testsuite/29_atomics/atomic/compare_exchange_padding.cc index 01f7475631e6..859629e625f8 100644 --- a/libstdc++-v3/testsuite/29_atomics/atomic/compare_exchange_padding.cc +++ b/libstdc++-v3/testsuite/29_atomics/atomic/compare_exchange_padding.cc @@ -1,5 +1,5 @@ // { dg-do run { target c++20 } } -// { dg-require-thread-fence "" } +// { dg-require-atomic-cmpxchg-word "" } // { dg-add-options libatomic } #include diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_flag/clear/1.cc b/libstdc++-v3/testsuite/29_atomics/atomic_flag/clear/1.cc index 89ed381fe057..2e154178dbd7 100644 --- a/libstdc++-v3/testsuite/29_atomics/atomic_flag/clear/1.cc +++ b/libstdc++-v3/testsuite/29_atomics/atomic_flag/clear/1.cc @@ -1,5 +1,5 @@ // { dg-do run { target c++11 } } -// { dg-require-thread-fence "" } +// { dg-require-atomic-cmpxchg-word "" } // Copyright (C) 2009-2023 Free Software Foundation, Inc. // diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_flag/cons/value_init.cc b/libstdc++-v3/testsuite/29_atomics/atomic_flag/cons/value_init.cc index f3f38b54dbcd..6439873be133 100644 --- a/libstdc++-v3/testsuite/29_atomics/atomic_flag/cons/value_init.cc +++ b/libstdc++-v3/testsuite/29_atomics/atomic_flag/cons/value_init.cc @@ -16,7 +16,7 @@ // . // { dg-do run { target c++20 } } -// { dg-require-thread-fence "" } +// { dg-require-atomic-cmpxchg-word "" } #include #include diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_flag/test_and_set/explicit.cc b/libstdc++-v3/testsuite/29_atomics/atomic_flag/test_and_set/explicit.cc index 6f723eb5f4e7..6cb1ae2b6dda 100644 --- a/libstdc++-v3/testsuite/29_atomics/atomic_flag/test_and_set/explicit.cc +++ b/libstdc++-v3/testsuite/29_atomics/atomic_flag/test_and_set/explicit.cc @@ -1,5 +1,5 @@ // { dg-do run { target c++11 } } -// { dg-require-thread-fence "" } +// { dg-require-atomic-cmpxchg-word "" } // Copyright (C) 2008-2023 Free Software Foundation, Inc. // diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_flag/test_and_set/implicit.cc b/libstdc++-v3/testsuite/29_atomics/atomic_flag/test_and_set/implicit.cc index 6f723eb5f4e7..6cb1ae2b6dda 100644 --- a/libstdc++-v3/testsuite/29_atomics/atomic_flag/test_and_set/implicit.cc +++ b/libstdc++-v3/testsuite/29_atomics/atomic_flag/test_and_set/implicit.cc @@ -1,5 +1,5 @@ // { dg-do run { target c++11 } } -// { dg-require-thread-fence "" } +// { dg-require-atomic-cmpxchg-word "" } // Copyright (C) 2008-2023 Free Software Foundation, Inc. // diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_ref/compare_exchange_padding.cc b/libstdc++-v3/testsuite/29_atomics/atomic_ref/compare_exchange_padding.cc index 2a3d1d468c22..25ccd2e94336 100644 --- a/libstdc++-v3/testsuite/29_atomics/atomic_ref/compare_exchange_padding.cc +++ b/libstdc++-v3/testsuite/29_atomics/atomic_ref/compare_exchange_padding.cc @@ -1,5 +1,5 @@ // { dg-do run { target c++20 } } -// { dg-require-thread-fence "" } +// { dg-require-atomic-cmpxchg-word "" } // { dg-add-options libatomic } #include diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_ref/generic.cc b/libstdc++-v3/testsuite/29_atomics/atomic_ref/generic.cc index f8751756d02c..c342b1aae292 100644 --- a/libstdc++-v3/testsuite/29_atomics/atomic_ref/generic.cc +++ b/libstdc++-v3/testsuite/29_atomics/atomic_ref/generic.cc @@ -16,7 +16,7 @@ // . // { dg-do run { target c++20 } } -// { dg-require-thread-fence "" } +// { dg-require-atomic-cmpxchg-word "" } // { dg-add-options libatomic } #include diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_ref/integral.cc b/libstdc++-v3/testsuite/29_atomics/atomic_ref/integral.cc index eb22afca03a2..134fb16506c3 100644 --- a/libstdc++-v3/testsuite/29_atomics/atomic_ref/integral.cc +++ b/libstdc++-v3/testsuite/29_atomics/atomic_ref/integral.cc @@ -16,7 +16,7 @@ // . // { dg-do run { target c++20 } } -// { dg-require-thread-fence "" } +// { dg-require-atomic-cmpxchg-word "" } // { dg-add-options libatomic } #include diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_ref/pointer.cc b/libstdc++-v3/testsuite/29_atomics/atomic_ref/pointer.cc index 6fe00b557567..fd26a053151f 100644 --- a/libstdc++-v3/testsuite/29_atomics/atomic_ref/pointer.cc +++ b/libstdc++-v3/testsuite/29_atomics/atomic_ref/pointer.cc @@ -16,7 +16,7 @@ // . // { dg-do run { target c++20 } } -// { dg-require-thread-fence "" } +// { dg-require-atomic-cmpxchg-word "" } // { dg-add-options libatomic } #include