public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/102177] New: Implement C++17 P0418R2
@ 2021-09-02 14:28 jakub at gcc dot gnu.org
  2021-09-02 14:28 ` [Bug c++/102177] " jakub at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-09-02 14:28 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 102177
           Summary: Implement C++17 P0418R2
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

I think we aren't implementing https://wg21.link/p0418r2
which dropped the requirement that failure mode can't be stronger than success
mode.
For
long
bar (long *x, long y, long z)
{
  __atomic_compare_exchange_n (x, &y, z, 0, __ATOMIC_RELAXED,
__ATOMIC_SEQ_CST);
  return y;
}
we warn:
warning: failure memory model cannot be stronger than success memory model for
‘__atomic_compare_exchange’ [-Winvalid-memory-model]
and document it in doc/extend.texi:
Otherwise, @code{false} is returned and memory is affected according
to @var{failure_memorder}. This memory order cannot be
@code{__ATOMIC_RELEASE} nor @code{__ATOMIC_ACQ_REL}.  It also cannot be a
stronger order than that specified by @var{success_memorder}.
and libstdc++ has:
        __glibcxx_assert(__b2 <= __b1);
in various spots in bits/atomic_base.h.

Do we emit right code on aarch64 and other weak ordering targets for this case
despite the warning?

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-04-21 15:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-02 14:28 [Bug c++/102177] New: Implement C++17 P0418R2 jakub at gcc dot gnu.org
2021-09-02 14:28 ` [Bug c++/102177] " jakub at gcc dot gnu.org
2021-09-02 14:40 ` jakub at gcc dot gnu.org
2021-09-02 15:14 ` jakub at gcc dot gnu.org
2021-09-02 17:51 ` cvs-commit at gcc dot gnu.org
2022-04-21 15:33 ` cvs-commit at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).