This is an archive of the discontinued LLVM Phabricator instance.

asan: fix atomic operations on ARM
ClosedPublic

Authored by dvyukov on Jan 20 2014, 6:01 AM.

Details

Reviewers
eugenis
Summary

implement correct atomic load/store for ARM
add test for atomic load/store

Diff Detail

Event Timeline

kcc added inline comments.Jan 20 2014, 6:26 AM
lib/sanitizer_common/sanitizer_atomic_clang.h
59

I would split this into multiple files (one with ifdef arm, etc)

eugenis added inline comments.Jan 20 2014, 7:00 AM
CMakeLists.txt
185 ↗(On Diff #6543)

Is this still needed if we use _sync_val_compare_and_swap and not hand-written assembly?

lib/sanitizer_common/sanitizer_atomic.h
56

Why not put the attribute on struct definition? AFAIK, this way 'atomic_uint64_t' is aligned, but "struct atomic_uint64_t" is not?

dvyukov updated this revision to Unknown Object (????).Jan 20 2014, 7:18 AM

add 2 separate files for x86 and other platforms
instead of ifdef spaghetti

dvyukov updated this revision to Unknown Object (????).Jan 22 2014, 4:41 AM

do not do
typedef X X;
instead do
typedef X Y;

eugenis accepted this revision.Jan 22 2014, 4:59 AM

LGTM

lib/sanitizer_common/sanitizer_atomic.h
40

It would be nice to rename the rest of these to _s + typedef, but that's optional.

dvyukov updated this revision to Unknown Object (????).Jan 22 2014, 5:51 AM

move ALIGNED to a different location

Eugene.Zelenko added a subscriber: Eugene.Zelenko.

Committed in r199802.