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

--- Comment #1 from Kostya Serebryany <kcc at gcc dot gnu.org> ---
I suspect a miscompile,
at least the following patch to the libsanitizer sources fixes the problem:

--- tsan_rtl.cc (revision 210145)
+++ tsan_rtl.cc (working copy)
@@ -584,7 +584,8 @@
   if (kGoMode || size < 64*1024) {
     u64 *p = (u64*)MemToShadow(addr);
     CHECK(IsShadowMem((uptr)p));
-    CHECK(IsShadowMem((uptr)(p + size * kShadowCnt / kShadowCell - 1)));
+    volatile uptr xxx = (uptr)(p + size * kShadowCnt / kShadowCell - 1);
+    CHECK(IsShadowMem(xxx));
     // FIXME: may overwrite a part outside the region
     for (uptr i = 0; i < size / kShadowCell * kShadowCnt;) {
       p[i++] = val;


Note the "volatile". W/o volatile tsan still crashes.

Reply via email to