This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/59785] atomic_store should load source operand atomically?


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]