[flang-commits] [flang] [Flang][OpenMP] Fix for threadprivate check in copyin clause (PR #181354)
Kiran Chandramohan via flang-commits
flang-commits at lists.llvm.org
Fri Feb 13 04:43:24 PST 2026
https://github.com/kiranchandramohan created https://github.com/llvm/llvm-project/pull/181354
Use the ultimate symbol in the threadprivate check
Fixes #180094
>From cd0949a4934988cdf8373d4548d31775d697f253 Mon Sep 17 00:00:00 2001
From: Kiran Chandramohan <kiran.chandramohan at arm.com>
Date: Thu, 12 Feb 2026 00:29:04 +0100
Subject: [PATCH] [Flang][OpenMP] Fix for threadprivate check in copyin clause
Use the ultimate symbol in the threadprivate check
Fixes #180094
---
flang/lib/Semantics/resolve-directives.cpp | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/flang/lib/Semantics/resolve-directives.cpp b/flang/lib/Semantics/resolve-directives.cpp
index 1fde0d62581e8..147a17a31b59f 100644
--- a/flang/lib/Semantics/resolve-directives.cpp
+++ b/flang/lib/Semantics/resolve-directives.cpp
@@ -3465,10 +3465,9 @@ void ResolveOmpParts(
}
static bool IsSymbolThreadprivate(const Symbol &symbol) {
- if (const auto *details{symbol.detailsIf<HostAssocDetails>()}) {
- return details->symbol().test(Symbol::Flag::OmpThreadprivate);
- }
- return symbol.test(Symbol::Flag::OmpThreadprivate);
+ const Symbol &ultimate{symbol.GetUltimate()};
+
+ return ultimate.test(Symbol::Flag::OmpThreadprivate);
}
static bool IsSymbolPrivate(const Symbol &symbol) {
More information about the flang-commits
mailing list