[flang-commits] [flang] [flang][OpenMP] Don't allow DO CONCURRENT inside of a loop nest (PR #144506)

Krzysztof Parzyszek via flang-commits flang-commits at lists.llvm.org
Tue Jun 17 08:51:44 PDT 2025


================
@@ -1952,6 +1952,12 @@ void OmpAttributeVisitor::PrivatizeAssociatedLoopIndexAndCheckLoopLevel(
   const auto &outer{std::get<std::optional<parser::DoConstruct>>(x.t)};
   if (outer.has_value()) {
     for (const parser::DoConstruct *loop{&*outer}; loop && level > 0; --level) {
+      if (loop->IsDoConcurrent()) {
+        auto &stmt =
+            std::get<parser::Statement<parser::NonLabelDoStmt>>(loop->t);
+        context_.Say(stmt.source,
+            "DO CONCURRENT loops cannot form part of a loop nest."_err_en_US);
+      }
----------------
kparzysz wrote:

I don't think it's allowed in any worksharing-loop construct, only in the LOOP construct [6.0:424:1] "The collapsed loop may be a DO CONCURRENT loop."  No other constructs in that chapter have this annotation.

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


More information about the flang-commits mailing list