public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/102218] New: 128-bit atomic compare and exchange does not honor memory model on AArch64 and Arm
@ 2021-09-06 14:29 tnfchris at gcc dot gnu.org
  2022-05-26 11:01 ` [Bug target/102218] " tnfchris at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: tnfchris at gcc dot gnu.org @ 2021-09-06 14:29 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 102218
           Summary: 128-bit atomic compare and exchange does not honor
                    memory model on AArch64 and Arm
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tnfchris at gcc dot gnu.org
  Target Milestone: ---

AArch64 and Arm libatomic do no support 128-bit atomics and so use the pthreads
fallback code on atomic operations.

The fallback code for atomic compare and exchange does the following

  pre_seq_barrier (smodel);
  magic = protect_start (mptr);

and for correctness relies on the target implementing pre_seq_barrier.

AArch64 and Arm however do not provide an implementation or pre_seq_barrier and
post_seq_barrier and the default implementations are just empty functions:

  static inline void __attribute__((always_inline, artificial))
  pre_seq_barrier(int model)
  {
  }

However for correctness on __ATOMIC_SEQ_CST a barrier needs to be emitted here
which isn't happening on any GCC version.

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

end of thread, other threads:[~2022-12-21  9:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-06 14:29 [Bug target/102218] New: 128-bit atomic compare and exchange does not honor memory model on AArch64 and Arm tnfchris at gcc dot gnu.org
2022-05-26 11:01 ` [Bug target/102218] " tnfchris at gcc dot gnu.org
2022-08-08 13:38 ` cvs-commit at gcc dot gnu.org
2022-08-08 13:38 ` cvs-commit at gcc dot gnu.org
2022-12-20 10:45 ` ktkachov at gcc dot gnu.org
2022-12-21  9:51 ` tnfchris 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).