http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55561
--- Comment #13 from Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> 2012-12-10 15:55:50 UTC --- (In reply to comment #12) > That's great that gcc tsan works for Fortran/OpenMP out of the box! I'm afraid it yields false positives. Something like this is supposed to be OK OMP-wise (and gives the right result in 10000 repetitions) but produces warnings. > cat test.f90 INTEGER, PARAMETER :: N=10 INTEGER :: data(N) !$OMP PARALLEL DO DO j=1,N data(j)=j ENDDO !$OMP PARALLEL DO DO j=N,1,-1 data(j)=data(j)-j ENDDO IF (ANY(data.NE.0)) CALL abort() END > gfortran -fsanitize=thread -O1 -g -fopenmp -fPIC -pie test.f90 ; ./a.out ================== WARNING: ThreadSanitizer: data race (pid=18871) > However, most likely Fortran/OpenMP will require some special handling to > produce better reports and catch more bugs (ThreadSanitizer reasons about > synchronization on pthread level, and not on OpenMP level). We won't have > spare > cycles for that in near future. > I am working on ThreadSanitizer tasking API, I would appreciate if you review > it and comment on whether it will fit Fortran/OpenMP model (the work is > currently in very early "what if" stage). I'm sure there are knowledgeable people reading the gcc list... posting this text there seems like a good idea.