https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52291

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2016-01-19
                 CC|                            |msebor at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |msebor at gcc dot 
gnu.org
     Ever confirmed|0                           |1

--- Comment #4 from Martin Sebor <msebor at gcc dot gnu.org> ---
I suspect this is not going to change for the __sync_xxx builtins that have
been made obsolete by the newer __atomic_xxx builtins.  Those, unfortunately,
have the same semantics as far as pointers as the former builtins.  Worse yet,
these semantics are exposed in the C11 atomic_xxx() generic functions, making
the latter incorrect.  For instance, atomic_fetch_add(p, N) is expected to be
equivalent to p += N for any object pointer p, but in GCC it only holds for
pointers to objects 1 byte wide (see bug 64843).

I agree that the __sync_xxx semantics should be clarified in the manual to
avoid any surprises.  Let me put something together.

Reply via email to