This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: PR libgomp/42602: libgomp.fortran/recursion1.f90 aborted at random
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: jakub at redhat dot com
- Date: Mon, 4 Jan 2010 06:20:14 -0800
- Subject: PATCH: PR libgomp/42602: libgomp.fortran/recursion1.f90 aborted at random
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
Hi,
The shared variable 's' is updated by multiple thread. This patch
makes it atomic. OK for trunk?
Thanks.
H.J.
----
2010-01-04 H.J. Lu <hongjiu.lu@intel.com>
PR libgomp/42602
* libgomp.fortran/recursion1.f90 (sub): Make 's' atomic.
diff --git a/libgomp/testsuite/libgomp.fortran/recursion1.f90 b/libgomp/testsuite/libgomp.fortran/recursion1.f90
index 0b7b271..35cb878 100644
--- a/libgomp/testsuite/libgomp.fortran/recursion1.f90
+++ b/libgomp/testsuite/libgomp.fortran/recursion1.f90
@@ -20,6 +20,7 @@ contains
subroutine sub (n)
integer :: n
+!$omp atomic
s = s + n
print '(A,i3)',"loop =",n
end subroutine