Do not use optimized atomic libcalls for misaligned atomics.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 7 Sep 2018 23:57:54 +0000 (23:57 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 7 Sep 2018 23:57:54 +0000 (23:57 +0000)
commitda3729d1e6998e8b57f210f6ba4accc6993645a3
tree0eb7457733522e7581ce8678b4cda42f647f402f
parent65f385da639368f933b14a98657b03c0a4a034d9
Do not use optimized atomic libcalls for misaligned atomics.

Summary:
The optimized (__atomic_foo_<n>) libcalls assume that the atomic object
is properly aligned, so should never be called on an underaligned
object.

This addresses one of several problems identified in PR38846.

Reviewers: jyknight, t.p.northover

Subscribers: jfb, cfe-commits

Differential Revision: https://reviews.llvm.org/D51817

llvm-svn: 341734
clang/lib/CodeGen/CGAtomic.cpp
clang/test/CodeGen/atomic-ops.c