tsan: properly instrument unaligned accesses
authorDmitry Vyukov <dvyukov@google.com>
Tue, 27 Jan 2015 20:19:12 +0000 (20:19 +0000)
committerDmitry Vyukov <dvyukov@google.com>
Tue, 27 Jan 2015 20:19:12 +0000 (20:19 +0000)
commit312ad250ff2c396bf5ff42fd8aaf132fda9218ce
treed967adbeae5f97e1f51ef7b2971e2fc3e18ff1fd
parentca49c036ba39bafe6a0c187be096f38a462dad13
tsan: properly instrument unaligned accesses

If a memory access is unaligned, emit __tsan_unaligned_read/write
callbacks instead of __tsan_read/write.
Required to change semantics of __tsan_unaligned_read/write to not do the user memory.
But since they were unused (other than through __sanitizer_unaligned_load/store) this is fine.
Fixes long standing issue 17:
https://code.google.com/p/thread-sanitizer/issues/detail?id=17

llvm-svn: 227230
compiler-rt/lib/tsan/rtl/tsan_interface.cc
compiler-rt/lib/tsan/rtl/tsan_interface.h
compiler-rt/test/tsan/aligned_vs_unaligned_race.cc
compiler-rt/test/tsan/unaligned_norace.cc