https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116717
Bug ID: 116717 Summary: bpf: fix built-in functions for memory model aware atomic operations. Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: jemarch at gcc dot gnu.org Target Milestone: --- Target: bpf At the moment the BPF target ignores the memory ordering arguments passed to atomic builtins, generating code that always implements monotonic ordering. We should change the target to emit instructions for the two ordering schemas supported by BPF: total and relaxed. __ATOMIC_RELAXED lock* instruction if result is not used, atomic_fetch_OP if it is used. __ATOMIC_CONSUME __ATOMIC_ACQUIRE __ATOMIC_RELEASE __ATOMIC_ACQ_REL __ATOMIC_SEQ_CST BPF: atomic_fetch_OP instructions. Note this is WIP in clang as well, with corresponding LLVM PR: https://github.com/llvm/llvm-project/pull/107343