[Bug libgomp/59194] tsan detects race for real variables in an OMP reduction clause
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Nov 20 13:51:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59194
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Because CPUs obviously don't have floating point atomic instructions, what the
compiler does is just load it as an integer, view convert to floating point,
perform arithmetics, view convert result back to integer, and compare and swap
(if unsuccessful loop). I bet tsan complains because the load is not atomic,
but does it really matter? If we read garbage there, compare and swap will
fail and next time we'll have hopefully correct value already from what compare
and swap said was the previous value.
More information about the Gcc-bugs
mailing list