[PATCH] D118024: [sanitizer_common] Use atomic builtin in sanitizer_atomic_clang.h

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 27 10:44:30 PST 2022


efriedma added inline comments.


================
Comment at: compiler-rt/lib/sanitizer_common/sanitizer_atomic_clang.h:78
+  return __atomic_compare_exchange(&a->val_dont_use, cmp, &xchg, false, mo,
+                                   __ATOMIC_RELAXED);
 }
----------------
ro wrote:
> efriedma wrote:
> > Please don't change the memory ordering in this patch.  (__sync_* is sequentially consistent.)  If you really want to change it, please post as a separate patch with an appropriate title.
> It wasn't clear to me from GCC's `__sync` builtin documentation that they are `__ATOMIC_SEQ_CST`.  I just assumed that `scudo/standalone/atomic_helpers.h` really implemented `atomic_compare_exchange_strong`.
> 
> As I mentioned, both `__ATOMIC_RELAXED` and `__ATOMIC_SEQ_CST` cause 3 regressions on Solaris/sparcv9, so this patch certainly cannot go in as is, despite fixing hundreds of link failures.
Still not changed completely to use SEQ_CST.  (__atomic_compare_exchange has two memory order operands.)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D118024/new/

https://reviews.llvm.org/D118024



More information about the llvm-commits mailing list