[Bug other/55439] New: ThreadSanitizer: handle atomic operations

dvyukov at google dot com gcc-bugzilla@gcc.gnu.org
Thu Nov 22 07:42:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55439

             Bug #: 55439
           Summary: ThreadSanitizer: handle atomic operations
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: dvyukov@google.com


ThreadSanitizer instrumentation pass need to intercept builtin atomic
operations.
In the other compiler we intercept __sync builtins, __atomic builtins, C1x
Atomic(T) and C1x/C++11 <atomic> atomics and translate them into calls into
runtime library.

For example,
atomic<int32_t> a;
a.load(memory_order_acquire);
is translated into:
__tsan_atomic32_load(&a, 2);

The runtime interface is described in libsanitizer/tsan/tsan_interface_atomic.h



More information about the Gcc-bugs mailing list