This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[gomp] Fix atomic-[39].[cC] on s390{,x}/sparc*
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Richard Henderson <rth at redhat dot com>, Diego Novillo <dnovillo at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 7 Dec 2005 17:18:00 -0500
- Subject: [gomp] Fix atomic-[39].[cC] on s390{,x}/sparc*
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
These 4 tests rely on __sync_fetch_and_add being used for #pragma omp
atomic. But on s390{,x} (where only sync_old_add[qh]i is implemented)
or sparc (no sync_old_add* at all) the atomic is expanded to
__sync_val_compare_and_swap. atomic-9.* can't match obviously and
although __sync_val_compare_and_swap is adding 4 to the location, it will
be burried somewhere in the gimplified setup code for the
__sync_val_compare_and_swap builtin.
Ok for gomp?
2005-12-07 Jakub Jelinek <jakub@redhat.com>
* gcc.dg/gomp/atomic-3.c: Conditionalize scan test on targets that
implement __sync_fetch_and_add.
* gcc.dg/gomp/atomic-9.c: Likewise.
* g++.dg/gomp/atomic-3.C: Likewise.
* g++.dg/gomp/atomic-9.C: Likewise.
--- gcc/testsuite/gcc.dg/gomp/atomic-3.c.jj 2005-10-28 22:55:08.000000000 +0200
+++ gcc/testsuite/gcc.dg/gomp/atomic-3.c 2005-12-07 23:07:34.000000000 +0100
@@ -9,5 +9,5 @@ void f1(void)
xyzzy++;
}
-/* { dg-final { scan-tree-dump-times "xyzzy, 4" 1 "gimple" } } */
+/* { dg-final { scan-tree-dump-times "xyzzy, 4" 1 "gimple" { target i?86-*-* x86_64-*-* ia64-*-* powerpc*-*-* alpha*-*-* } } } */
/* { dg-final { cleanup-tree-dump "gimple" } } */
--- gcc/testsuite/gcc.dg/gomp/atomic-9.c.jj 2005-10-28 22:55:08.000000000 +0200
+++ gcc/testsuite/gcc.dg/gomp/atomic-9.c 2005-12-07 23:08:25.000000000 +0100
@@ -9,5 +9,5 @@ void f1(void)
*bar() += 1;
}
-/* { dg-final { scan-tree-dump-times "__sync_fetch_and_add" 1 "gimple" } } */
+/* { dg-final { scan-tree-dump-times "__sync_fetch_and_add" 1 "gimple" { target i?86-*-* x86_64-*-* ia64-*-* powerpc*-*-* alpha*-*-* } } } */
/* { dg-final { cleanup-tree-dump "gimple" } } */
--- gcc/testsuite/g++.dg/gomp/atomic-3.C.jj 2005-10-28 22:58:24.000000000 +0200
+++ gcc/testsuite/g++.dg/gomp/atomic-3.C 2005-12-07 23:08:49.000000000 +0100
@@ -9,5 +9,5 @@ void f1(void)
xyzzy++;
}
-/* { dg-final { scan-tree-dump-times "xyzzy, 4" 1 "gimple" } } */
+/* { dg-final { scan-tree-dump-times "xyzzy, 4" 1 "gimple" { target i?86-*-* x86_64-*-* ia64-*-* powerpc*-*-* alpha*-*-* } } } */
/* { dg-final { cleanup-tree-dump "gimple" } } */
--- gcc/testsuite/g++.dg/gomp/atomic-9.C.jj 2005-10-28 22:58:24.000000000 +0200
+++ gcc/testsuite/g++.dg/gomp/atomic-9.C 2005-12-07 23:09:01.000000000 +0100
@@ -9,5 +9,5 @@ void f1(void)
*bar() += 1;
}
-/* { dg-final { scan-tree-dump-times "__sync_fetch_and_add" 1 "gimple" } } */
+/* { dg-final { scan-tree-dump-times "__sync_fetch_and_add" 1 "gimple" { target i?86-*-* x86_64-*-* ia64-*-* powerpc*-*-* alpha*-*-* } } } */
/* { dg-final { cleanup-tree-dump "gimple" } } */
Jakub