[PATCH] tsan: properly instrument unaligned accesses

Dmitry Vyukov dvyukov at google.com
Mon Jan 19 06:09:38 PST 2015


Hi kcc, samsonov,

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

http://reviews.llvm.org/D7053

Files:
  lib/Transforms/Instrumentation/ThreadSanitizer.cpp
  lib/tsan/rtl/tsan_interface.cc
  lib/tsan/rtl/tsan_interface.h
  test/Instrumentation/ThreadSanitizer/unaligned.ll
  test/tsan/aligned_vs_unaligned_race.cc
  test/tsan/unaligned_norace.cc

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7053.18389.patch
Type: text/x-patch
Size: 14642 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150119/a2539afb/attachment.bin>


More information about the llvm-commits mailing list