This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libgomp/42602] libgomp.fortran/recursion1.f90 aborted at random



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]