[Openmp-commits] [openmp] [OpenMP] Fix a few race conditions in the OpenMP runtime (PR #207281)

Robert Imschweiler via Openmp-commits openmp-commits at lists.llvm.org
Fri Jul 3 01:28:44 PDT 2026


================
@@ -234,8 +235,9 @@ lookupPtr(ValueKind Kind, bool IsReadonly, bool ForceTeamState) {
 /// update ICV values we can declare in global scope.
 template <typename Ty, ValueKind Kind> struct Value {
   [[gnu::flatten, gnu::always_inline]] operator Ty() {
-    return lookup(/*IsReadonly=*/true, /*IdentTy=*/nullptr,
-                  /*ForceTeamState=*/false);
+    return atomic::load(&lookup(/*IsReadonly=*/true, /*IdentTy=*/nullptr,
----------------
ro-i wrote:

isn't the write to HasThreadState still racey?

https://github.com/llvm/llvm-project/pull/207281


More information about the Openmp-commits mailing list