[flang-commits] [PATCH] D114209: [flang] Add -fno-automatic, refine IsSaved()

Jean Perier via Phabricator via flang-commits flang-commits at lists.llvm.org
Fri Nov 19 00:37:39 PST 2021


jeanPerier accepted this revision.
jeanPerier added a comment.
This revision is now accepted and ready to land.

Please double check that you indeed want to SAVE **all** main program variables and check  clang/lib/Driver/ToolChains/Flang.cpp formatting. Otherwise the semantics/evaluate changes look good to me.



================
Comment at: clang/lib/Driver/ToolChains/Flang.cpp:33
                 options::OPT_fxor_operator, options::OPT_fno_xor_operator,
+                options::OPT_fno_automatic,
                 options::OPT_falternative_parameter_statement,
----------------
It looks like clang-format is unhappy here.


================
Comment at: flang/lib/Evaluate/tools.cpp:1203
+  } else if (scopeKind == Scope::Kind::Module ||
+      scopeKind == Scope::Kind::MainProgram) {
+    // 8.5.16p4; BLOCK DATA entities must all be in COMMON,
----------------
This will trigger all main program objects to be static, whether they are scalars or not right ?

Currently, lowering was promoting main program array objects to static storage, but not scalars (which matches nvfortran/classic flang). Do we want/need a different behavior here ? 


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114209/new/

https://reviews.llvm.org/D114209



More information about the flang-commits mailing list