[flang-commits] [flang] [flang][OpenMP] Initialize allocatable members of derived types (PR #120295)

Tom Eccles via flang-commits flang-commits at lists.llvm.org
Fri Jan 10 09:56:15 PST 2025


================
@@ -165,8 +182,8 @@ bool DataSharingProcessor::needBarrier() {
   // variables.
   // Emit implicit barrier for linear clause. Maybe on somewhere else.
   for (const semantics::Symbol *sym : allPrivatizedSymbols) {
-    if (sym->test(semantics::Symbol::Flag::OmpFirstPrivate) &&
-        sym->test(semantics::Symbol::Flag::OmpLastPrivate))
+    if (sym->test(semantics::Symbol::Flag::OmpLastPrivate) &&
+        (sym->test(semantics::Symbol::Flag::OmpFirstPrivate) || callsInitClone))
----------------
tblah wrote:

The original variable is also used for other similar cases e.g. assumed shape arrays. Maybe for now we should always use the barrier?

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


More information about the flang-commits mailing list