]> granicus.if.org Git - clang/commit
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)
commitbfe49d565c4fe4c87c797bf4319e7e673ef4dbb2
treed6b8e977e8e4609828edf467b9a288181dc11bc3
parente1e8e05bd99209ba8c7cb0a303f83e6833222640
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@341734 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGAtomic.cpp
test/CodeGen/atomic-ops.c