From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1059) id 1AA6D393C848; Thu, 27 Aug 2020 18:15:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1AA6D393C848 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1598552118; bh=XCGfjozv0qko2km/bDCcBJVyiHeLDDJO9fuQc7f+opk=; h=From:To:Subject:Date:From; b=QKdQiJOB05bhdrV7JF59+LttY+wJ1ME27+fdnLX6dBw+coIdeE0yx5N1zJupAKrTB rtMQDXMD3IiJ/cmU30zwTtJ8WZYOyGlmIMyR4lTJQzOJd/DMPyJIQiTqM4BJuxBa2O eNvIpbSnM7PBkCqXhiM7972C94XxKzvGfdnyNbUg= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Nathan Sidwell To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/c++-modules] [testsuite, nvptx] Add effective target sync_int_long_stack X-Act-Checkin: gcc X-Git-Author: Tom de Vries X-Git-Refname: refs/heads/devel/c++-modules X-Git-Oldrev: a7bbb5b1b1eb09db8175130474e8da952f30404b X-Git-Newrev: 9eaf11417b6a017b21a5052a74be3d2a251cfb78 Message-Id: <20200827181518.1AA6D393C848@sourceware.org> Date: Thu, 27 Aug 2020 18:15:18 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 18:15:18 -0000 https://gcc.gnu.org/g:9eaf11417b6a017b21a5052a74be3d2a251cfb78 commit 9eaf11417b6a017b21a5052a74be3d2a251cfb78 Author: Tom de Vries Date: Mon Aug 10 15:42:38 2020 +0200 [testsuite, nvptx] Add effective target sync_int_long_stack 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 addresses. Build on nvptx and tested with make check-gcc. 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. Diff: --- gcc/testsuite/gcc.dg/pr86314.c | 2 +- gcc/testsuite/lib/target-supports.exp | 14 +++++++++++++- 2 files changed, 14 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 4e0d45aaae5..f223fc6917e 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -7704,7 +7704,19 @@ 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*-*-*] + }}] +} + +# Return 1 if the target supports atomic operations on "int" and "long" on +# stack addresses. + +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".