[compiler-rt] f3b3c96 - Revert "[tsan] Fix GCC 8.3 build after D107911"

Marco Elver via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 17 10:26:49 PDT 2021


Author: Marco Elver
Date: 2021-08-17T19:26:20+02:00
New Revision: f3b3c964c3a1d5072c2b489ec54c9a2ad5df3ddb

URL: https://github.com/llvm/llvm-project/commit/f3b3c964c3a1d5072c2b489ec54c9a2ad5df3ddb
DIFF: https://github.com/llvm/llvm-project/commit/f3b3c964c3a1d5072c2b489ec54c9a2ad5df3ddb.diff

LOG: Revert "[tsan] Fix GCC 8.3 build after D107911"

This reverts commit 797fe59e6b9512652c0ae5a6b69a3c6f5a573fcd.

The use of "EventType type : 3" is replicated for all Event structs and
therefore was still present. As a result this still caused failures on
older GCCs (9.2 or 8.3 or earlier).

The particular bot that was failing due to buggy GCC was fixed by
fef39cc472a773fae4761deaab1c701024ad13ec.

Therefore, no reason to keep the workaround around; revert it.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D108192

Added: 
    

Modified: 
    compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp
    compiler-rt/lib/tsan/rtl/tsan_trace.h

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp b/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp
index db5070180442..49e867a63aa9 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp
+++ b/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp
@@ -472,7 +472,7 @@ void TraceReplay(Trace *trace, TracePart *last, Event *last_pos, Sid sid,
     for (Event *evp = &part->events[0]; evp < end; evp++) {
       Event *evp0 = evp;
       if (!evp->is_access && !evp->is_func) {
-        switch (evp->GetType()) {
+        switch (evp->type) {
           case EventType::kTime: {
             auto *ev = reinterpret_cast<EventTime *>(evp);
             ev_sid = static_cast<Sid>(ev->sid);
@@ -573,7 +573,7 @@ bool RestoreStack(Tid tid, EventType type, Sid sid, Epoch epoch, uptr addr,
       [&](Sid ev_sid, Epoch ev_epoch, Event *evp) {
         bool match = ev_sid == sid && ev_epoch == epoch;
         if (evp->is_access) {
-          if (evp->is_func == 0 && evp->GetType() == EventType::kAccessExt &&
+          if (evp->is_func == 0 && evp->type == EventType::kAccessExt &&
               evp->_ == 0)  // NopEvent
             return;
           auto *ev = reinterpret_cast<EventAccess *>(evp);
@@ -602,7 +602,7 @@ bool RestoreStack(Tid tid, EventType type, Sid sid, Epoch epoch, uptr addr,
           }
           return;
         }
-        switch (evp->GetType()) {
+        switch (evp->type) {
           case EventType::kAccessExt: {
             auto *ev = reinterpret_cast<EventAccessExt *>(evp);
             uptr ev_addr = RestoreAddr(ev->addr);

diff  --git a/compiler-rt/lib/tsan/rtl/tsan_trace.h b/compiler-rt/lib/tsan/rtl/tsan_trace.h
index b48810aa82a1..a771ad9f52fd 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_trace.h
+++ b/compiler-rt/lib/tsan/rtl/tsan_trace.h
@@ -87,17 +87,13 @@ struct Event {
   // Otherwise type denotes the type.
   u64 is_access : 1;
   u64 is_func : 1;
-  u64 type : 3;
+  EventType type : 3;
   u64 _ : 59;
-
-  EventType GetType() const {
-    return static_cast<EventType>(type);
-  }
 };
 static_assert(sizeof(Event) == 8, "bad Event size");
 
 // Nop event used as padding and does not affect state during replay.
-static constexpr Event NopEvent = {1, 0, static_cast<u64>(EventType::kAccessExt), 0};
+static constexpr Event NopEvent = {1, 0, EventType::kAccessExt, 0};
 
 // Compressed memory access can represent only some events with PCs
 // close enough to each other. Otherwise we fall back to EventAccessExt.


        


More information about the llvm-commits mailing list