[Bug c/59785] atomic_store should load source operand atomically?
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Jan 13 12:33:00 GMT 2014
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59785
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
CC| |jakub at gcc dot gnu.org
Resolution|--- |INVALID
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
It is atomic store, not atomic load, what do you expect?
The only reason for taking val as a pointer rather than the value itself is
that some values really need to live in memory and the API is generic. If you
are trying to pass an address of a var that is modified by other threads, it is
just a bug in your source code, you likely want to do an atomic load into a
temporary automatic variable etc. which won't be modified by other threads and
only then atomic_store it.
More information about the Gcc-bugs
mailing list