Fix PR libgomp/66761 and PR libgomp/67303 (tsan warnings)
VandeVondele Joost
joost.vandevondele@mat.ethz.ch
Sat Aug 22 11:15:00 GMT 2015
The following fixes two warnings reported by tsan when running OMP'ed code. As suggested by Andrew Pinski in PR67303 for gomp_iter_guided_next, by employing a relaxed atomic load. The same pattern occurred a couple of more times, so fixed as well. I used the same approach for the warning in do_spin (PR66761), even though this is a different context.
Bootstrapped and regtested on x86_64-unknown-linux-gnu for trunk, and manually verified that the PR is fixed using a tsan compiled libgomp based on gcc-5.1.
OK for trunk ?
This applies without changes to the 5 branch, should I commit there as well ?
libgomp/ChangeLog:
2015-08-22 Joost VandeVondele <vondele@gnu.gcc.org>
PR libgomp/66761
PR libgomp/67303
* iter.c (gomp_iter_dynamic_next): Employ an atomic load.
(gomp_iter_guided_next): Idem.
* iter_ull.c (gomp_iter_ull_dynamic_next): Idem.
(gomp_iter_ull_guided_next): Idem.
* config/linux/wait.h (do_spin): Idem.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-tsan-libgomp-v01.diff
Type: text/x-patch
Size: 1984 bytes
Desc: patch-tsan-libgomp-v01.diff
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20150822/1f20d2e1/attachment.bin>
More information about the Gcc-patches
mailing list