aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Lower/OpenMP/OpenMP.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'flang/lib/Lower/OpenMP/OpenMP.cpp')
-rw-r--r--flang/lib/Lower/OpenMP/OpenMP.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/flang/lib/Lower/OpenMP/OpenMP.cpp b/flang/lib/Lower/OpenMP/OpenMP.cpp
index 70e58d8..5e1f3b0 100644
--- a/flang/lib/Lower/OpenMP/OpenMP.cpp
+++ b/flang/lib/Lower/OpenMP/OpenMP.cpp
@@ -2089,7 +2089,13 @@ genSectionsOp(lower::AbstractConverter &converter, lower::SymMap &symTable,
const auto &objList = std::get<ObjectList>(lastp->t);
for (const Object &object : objList) {
semantics::Symbol *sym = object.sym();
- converter.copyHostAssociateVar(*sym, &insp, /*hostIsSource=*/false);
+ if (const auto *common =
+ sym->detailsIf<semantics::CommonBlockDetails>()) {
+ for (const auto &obj : common->objects())
+ converter.copyHostAssociateVar(*obj, &insp, /*hostIsSource=*/false);
+ } else {
+ converter.copyHostAssociateVar(*sym, &insp, /*hostIsSource=*/false);
+ }
}
}
}