[PATCH] D45319: [Atomics] warn about misaligned atomic accesses using libcalls

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 5 12:36:00 PDT 2018


rsmith added a comment.
Herald added a subscriber: jfb.

There's still something wrong here: in the cases where we produce these warnings, we still produce calls to `__atomic_*_<n>` library functions. Those functions are specified to only work on properly-aligned inputs, so that's wrong. And there seems to be a problem with alignment in compiler-rt too: the "unoptimized" `__atomic_load_n` implementation only looks at the size and not the alignment of the pointer when determining whether to use a lock.

See also PR38846.


Repository:
  rC Clang

https://reviews.llvm.org/D45319





More information about the cfe-commits mailing list