From patchwork Wed Aug 12 13:57:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 1343696 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=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.de Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (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 4BRWVN1pTmz9sTN for ; Wed, 12 Aug 2020 23:57:30 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C0D003857C4D; Wed, 12 Aug 2020 13:57:27 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id E4D4E3857C40 for ; Wed, 12 Aug 2020 13:57:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E4D4E3857C40 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tdevries@suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 8F5FFAD12 for ; Wed, 12 Aug 2020 13:57:46 +0000 (UTC) Date: Wed, 12 Aug 2020 15:57:23 +0200 From: Tom de Vries To: gcc-patches@gcc.gnu.org Subject: [PATCH][testsuite, nvptx] Add effective target sync_int_long_stack Message-ID: <20200812135722.GA18324@delia> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 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: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Hi, The nvptx target currently doesn't support effective target sync_int_long, although it has support for 32-bit and 64-bit atomic. When enabling sync_int_long for nvptx, we run into a failure in gcc.dg/pr86314.c: ... nvptx-run: error getting kernel result: operation not supported on \ global/shared address space ... due to a ptx restriction: accesses to local memory are illegal, and the test-case does an atomic operation on a stack address, which is mapped to local memory. Fix this by adding a target sync_int_long_stack, wich returns false for nvptx, which can be used to mark test-cases that require sync_int_long support for stack address. Build on nvptx and tested with make check-gcc. OK for trunk? Thanks, - Tom [testsuite, nvptx] Add effective target sync_int_long_stack gcc/testsuite/ChangeLog: PR target/96494 * lib/target-supports.exp (check_effective_target_sync_int_long): Return 1 for nvptx. (check_effective_target_sync_int_long_stack): New proc. * gcc.dg/pr86314.c: Require effective target sync_int_long_stack. --- gcc/testsuite/gcc.dg/pr86314.c | 2 +- gcc/testsuite/lib/target-supports.exp | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/gcc/testsuite/gcc.dg/pr86314.c b/gcc/testsuite/gcc.dg/pr86314.c index 8962a3cf2ff..565fb02eee2 100644 --- a/gcc/testsuite/gcc.dg/pr86314.c +++ b/gcc/testsuite/gcc.dg/pr86314.c @@ -1,5 +1,5 @@ // PR target/86314 -// { dg-do run { target sync_int_long } } +// { dg-do run { target sync_int_long_stack } } // { dg-options "-O2" } __attribute__((noinline, noclone)) unsigned long diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index e79015b4d54..a870b1de275 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -7704,7 +7704,16 @@ proc check_effective_target_sync_int_long { } { || [istarget cris-*-*] || ([istarget sparc*-*-*] && [check_effective_target_sparc_v9]) || ([istarget arc*-*-*] && [check_effective_target_arc_atomic]) - || [check_effective_target_mips_llsc] }}] + || [check_effective_target_mips_llsc] + || [istarget nvptx*-*-*] + }}] +} + +proc check_effective_target_sync_int_long_stack { } { + return [check_cached_effective_target sync_int_long_stack { + expr { ![istarget nvptx*-*-*] + && [check_effective_target_sync_int_long] + }}] } # Return 1 if the target supports atomic operations on "char" and "short".