https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64843
--- Comment #8 from joseph at codesourcery dot com ---
I think we should keep the built-in function semantics as-is, and fix
stdatomic.h along the lines I proposed in comment#3.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64843
Martin Sebor changed:
What|Removed |Added
CC||msebor at gcc dot gnu.org
Known to f
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64843
--- Comment #6 from Jonathan Wakely ---
(In reply to Richard Smith from comment #2)
> libstdc++ uses these builtins in bits/atomic_base.h:
>
> __pointer_type
> fetch_add(ptrdiff_t __d,
> memory_order __m = memory_orde
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64843
--- Comment #5 from Richard Smith ---
(In reply to jos...@codesourcery.com from comment #3)
> The first question is whether this code is actually valid.
To my reading, the C11 standard says that these operations must work on all
atomic integer t
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64843
--- Comment #4 from joseph at codesourcery dot com ---
(And this shows an admission from the tests - a new
gcc.dg/atomic/stdatomic-op-*.c test should be added that tests _add and
_sub for pointer types.)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64843
--- Comment #3 from joseph at codesourcery dot com ---
The first question is whether this code is actually valid. C11 says "All
of these operations are applicable to an object of any atomic integer
type.", not mentioning pointer types as valid
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64843
--- Comment #2 from Richard Smith ---
libstdc++ uses these builtins in bits/atomic_base.h:
__pointer_type
fetch_add(ptrdiff_t __d,
memory_order __m = memory_order_seq_cst) noexcept
{ return __atomic_fetch_add(&_
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64843
Richard Biener changed:
What|Removed |Added
Keywords||documentation, wrong-code
S