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

Reply via email to