Dear PowerPC maintainers, all,

Following commit r17-1806-gd50e9f17fffa9b, my colleague Thomas reported the newly added test c-c++-common/gomp/atomic-builtins-1.c was failing on powerpc64le due to its hardware support for 16B atomic operations, and suggested to update check_effective_target_sync_int_128, which I did in the attached patch.

Is it OK to have this check return true for powerpc64le in the testsuite?

Thanks,
--
PA
From 2effdfd43661913318ca46028a2659f37c748d48 Mon Sep 17 00:00:00 2001
From: Paul-Antoine Arras <[email protected]>
Date: Fri, 26 Jun 2026 11:08:04 +0200
Subject: [PATCH] testsuite: Skip atomic-builtins-1 on targets with
 sync_int_128 support

The test checks that __int128 OMP atomic operations expand to
GOMP_atomic_start/end when hardware 128-bit atomic support is
unavailable.  It should not run on targets that do support such
operations natively.

Update check_effective_target_sync_int_128 to return 1 for
powerpc64le, which has hardware 128-bit atomic support, and
restrict the test to targets where that effective target is false.

gcc/testsuite/ChangeLog:

	* c-c++-common/gomp/atomic-builtins-1.c: Skip test when
	sync_int_128 is available.
	* lib/target-supports.exp
	(check_effective_target_sync_int_128): Return 1 for powerpc64le.
---
 gcc/testsuite/c-c++-common/gomp/atomic-builtins-1.c | 2 +-
 gcc/testsuite/lib/target-supports.exp               | 6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git gcc/testsuite/c-c++-common/gomp/atomic-builtins-1.c gcc/testsuite/c-c++-common/gomp/atomic-builtins-1.c
index d33f2810716..0742efc8731 100644
--- gcc/testsuite/c-c++-common/gomp/atomic-builtins-1.c
+++ gcc/testsuite/c-c++-common/gomp/atomic-builtins-1.c
@@ -1,4 +1,4 @@
-/* { dg-do compile { target int128 } } */
+/* { dg-do compile { target { int128 && { ! sync_int_128 } } } } */
 /* { dg-additional-options "-fdump-tree-ompexp" } */
 
 /* Check that an GIMPLE_OMP_ATOMIC statement expands to GOMP_atomic_start/end
diff --git gcc/testsuite/lib/target-supports.exp gcc/testsuite/lib/target-supports.exp
index c6ebbed4f4b..84892c90a4b 100644
--- gcc/testsuite/lib/target-supports.exp
+++ gcc/testsuite/lib/target-supports.exp
@@ -10350,7 +10350,11 @@ proc check_effective_target_section_anchors { } {
 # Return 1 if the target supports atomic operations on "int_128" values.
 
 proc check_effective_target_sync_int_128 { } {
-    return 0
+    if { [istarget powerpc64le-*-*] } {
+	return 1
+    } else {
+	return 0
+    }
 }
 
 # Return 1 if the target supports atomic operations on "int_128" values
-- 
2.39.5

Reply via email to