From patchwork Tue Sep 14 08:42:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 44981 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A7423385802D for ; Tue, 14 Sep 2021 08:43:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A7423385802D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1631608988; bh=YGca5ccxgSzGAM5chN+YnJEHUuFVKCZf3s17F3hzWwo=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=cKxd+ShbqJ2bw+khhzHeFP094BWoy8onfXXkeMsceh2mXUWqG6+Mlk6WfZTCncQUy ktr4quFcj0WsMk/srMX9L0ir00cZHSwh6qivL1x7gHu0OFtaJI48Lpd04gmQ8GRva1 0Yenk12ASCxOxj/K7eUK4qySq8SIpja8X4UKx4QM= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 990C33858402 for ; Tue, 14 Sep 2021 08:42:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 990C33858402 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-593-aj5ZFvPKPFaWOXKiECrXZQ-1; Tue, 14 Sep 2021 04:42:37 -0400 X-MC-Unique: aj5ZFvPKPFaWOXKiECrXZQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3AE288064BB for ; Tue, 14 Sep 2021 08:42:32 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.10]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DBE641973B for ; Tue, 14 Sep 2021 08:42:31 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.16.1/8.16.1) with ESMTPS id 18E8gTUK1720803 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Tue, 14 Sep 2021 10:42:30 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.16.1/8.16.1/Submit) id 18E8gTnL1720802 for gcc-patches@gcc.gnu.org; Tue, 14 Sep 2021 10:42:29 +0200 Date: Tue, 14 Sep 2021 10:42:29 +0200 To: gcc-patches@gcc.gnu.org Subject: [committed] testsuite: Use sync_long_long instead of sync_int_long for atomic-29.c test Message-ID: <20210914084229.GT304296@tucnak> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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: 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: , X-Patchwork-Original-From: Jakub Jelinek via Gcc-patches From: Jakub Jelinek Reply-To: Jakub Jelinek Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Hi! As discussed, the test tests atomics on doubles which are 64-bit and so we should use sync_long_long effective target instead of sync_int_long that covers 64-bit atomics only on 64-bit arches. I've added -march=pentium to follow what is documented for sync_long_long, I guess -march=zarch should be added for s390* too, but haven't tested that. And using sync_long_long found a syntax error in that effective target implementation, so I've fixed that too. Regtested on x86_64-linux and i686-linux, committed to trunk. 2021-09-14 Jakub Jelinek * c-c++-common/gomp/atomic-29.c: Add -march=pentium dg-additional-options for ia32. Use sync_long_long effective target instead of sync_int_long. * lib/target-supports.exp (check_effective_target_sync_long_long): Fix a syntax error. Jakub --- gcc/testsuite/c-c++-common/gomp/atomic-29.c.jj 2021-09-11 09:33:37.897331795 +0200 +++ gcc/testsuite/c-c++-common/gomp/atomic-29.c 2021-09-13 16:52:39.212099370 +0200 @@ -1,10 +1,11 @@ /* { dg-do compile { target c } } */ /* { dg-additional-options "-O2 -fdump-tree-ompexp" } */ -/* { dg-final { scan-tree-dump-times "\.ATOMIC_COMPARE_EXCHANGE \\\(\[^\n\r]*, 8, 5, 5\\\);" 1 "ompexp" { target sync_int_long } } } */ -/* { dg-final { scan-tree-dump-times "\.ATOMIC_COMPARE_EXCHANGE \\\(\[^\n\r]*, 8, 4, 2\\\);" 1 "ompexp" { target sync_int_long } } } */ -/* { dg-final { scan-tree-dump-times "\.ATOMIC_COMPARE_EXCHANGE \\\(\[^\n\r]*, 264, 5, 0\\\);" 1 "ompexp" { target sync_int_long } } } */ -/* { dg-final { scan-tree-dump-times "\.ATOMIC_COMPARE_EXCHANGE \\\(\[^\n\r]*, 8, 0, 0\\\);" 1 "ompexp" { target sync_int_long } } } */ -/* { dg-final { scan-tree-dump-not "__atomic_load_8 \\\(" "ompexp" { target sync_int_long } } } */ +/* { dg-additional-options "-march=pentium" { target ia32 } } */ +/* { dg-final { scan-tree-dump-times "\.ATOMIC_COMPARE_EXCHANGE \\\(\[^\n\r]*, 8, 5, 5\\\);" 1 "ompexp" { target sync_long_long } } } */ +/* { dg-final { scan-tree-dump-times "\.ATOMIC_COMPARE_EXCHANGE \\\(\[^\n\r]*, 8, 4, 2\\\);" 1 "ompexp" { target sync_long_long } } } */ +/* { dg-final { scan-tree-dump-times "\.ATOMIC_COMPARE_EXCHANGE \\\(\[^\n\r]*, 264, 5, 0\\\);" 1 "ompexp" { target sync_long_long } } } */ +/* { dg-final { scan-tree-dump-times "\.ATOMIC_COMPARE_EXCHANGE \\\(\[^\n\r]*, 8, 0, 0\\\);" 1 "ompexp" { target sync_long_long } } } */ +/* { dg-final { scan-tree-dump-not "__atomic_load_8 \\\(" "ompexp" { target sync_long_long } } } */ double x; --- gcc/testsuite/lib/target-supports.exp.jj 2021-09-08 11:23:44.380036173 +0200 +++ gcc/testsuite/lib/target-supports.exp 2021-09-14 09:56:11.240510238 +0200 @@ -8074,7 +8074,7 @@ proc check_effective_target_sync_int_128 # Note: 32bit s390 targets require -mzarch in dg-options. proc check_effective_target_sync_long_long { } { - if { [istarget i?86-*-*] || [istarget x86_64-*-*]) + if { [istarget i?86-*-*] || [istarget x86_64-*-*] || [istarget aarch64*-*-*] || [istarget arm*-*-*] || [istarget alpha*-*-*]