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.
Paths
| Differential D51817
Do not use optimized atomic libcalls for misaligned atomics. ClosedPublic Authored by rsmith on Sep 7 2018, 2:28 PM.
Details Summary The optimized (__atomic_foo_<n>) libcalls assume that the atomic object This addresses one of several problems identified in PR38846.
Diff Detail
Event Timeline
This revision is now accepted and ready to land.Sep 7 2018, 4:37 PM Closed by commit rC341734: Do not use optimized atomic libcalls for misaligned atomics. (authored by rsmith). · Explain WhySep 7 2018, 4:59 PM Closed by commit rL341734: Do not use optimized atomic libcalls for misaligned atomics. (authored by rsmith). · Explain Why This revision was automatically updated to reflect the committed changes. This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 164544 lib/CodeGen/CGAtomic.cpp
test/CodeGen/atomic-ops.c
|
Is there any particular reason to expect that the pointer operand to __atomic_load_n can't be misaligned? I mean, for most ABIs, integers are naturally aligned, but that isn't actually a hard rule.