[flang-commits] [flang] [flang] Classify MOVE_ALLOC with noncoarray FROM as SIMPLE (PR #224923)

Eugene Epshteyn via flang-commits flang-commits at lists.llvm.org
Sun Oct 11 16:53:09 PDT 2026


================
@@ -2877,9 +2877,12 @@ std::optional<SpecificCall> IntrinsicInterface::Match(
   }
   if (call.isSubroutineCall) {
     if (intrinsicClass == IntrinsicClass::pureSubroutine /* MOVE_ALLOC */) {
-      // TODO: set Attr::Simple for MOVE_ALLOC when FROM is not a coarray
-      // (F2023)
-      attrs.set(characteristics::Procedure::Attr::Pure);
+      // F2023 16.9.147 p2: MOVE_ALLOC is simple if and only if FROM is not a
+      // coarray
----------------
eugeneepshteyn wrote:

Nit: this explains when `MOVE_ALLOC` is simple, but not why `Pure` is withheld too for a coarray `FROM`. Also citing F2023 16.1 p5 ("No other standard intrinsic subroutine is pure or simple") would say that, so nobody later moves `Pure` back out of the `if`.

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


More information about the flang-commits mailing list