This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libgomp/42602] libgomp.fortran/recursion1.f90 aborted at random
- From: "jakub at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Jan 2010 08:02:32 -0000
- Subject: [Bug libgomp/42602] libgomp.fortran/recursion1.f90 aborted at random
- References: <bug-42602-682@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from jakub at gcc dot gnu dot org 2010-01-04 08:02 -------
There is no such guarantee, the testcase contains data race.
It can increment a shared variable in multiple threads using non-atomic
instructions. One fix would be to use
!$omp atomic
s = s + n
instead of just
s = s + n
Or put s = s + n into !$omp single, or use some other kind of locking.
--
jakub at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2010-01-04 08:02:31
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42602