[flang-commits] [flang] [flang][OpenACC] Release declare-create allocatable on deallocate (PR #220541)

Slava Zakharin via flang-commits flang-commits at lists.llvm.org
Wed Sep 2 08:14:00 PDT 2026


================
@@ -5334,6 +5336,12 @@ void Fortran::lower::attachDeclarePostDeallocAction(
   if (isUnifiedMemoryMode(converter))
     return;
 
+  // A module variable has no post-dealloc recipe: it would run once the
+  // descriptor no longer holds the address the mapping is keyed on.
+  if (sym.GetUltimate().owner().kind() ==
+      Fortran::semantics::Scope::Kind::Module)
+    return;
+
----------------
vzakhari wrote:

Do we have the same issue for local acc declare ALLOCATABLE variables?

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


More information about the flang-commits mailing list