[flang-commits] [flang] [flang][semantics] fix crash involving equivalences (PR #168909)

Andre Kuhlenschmidt via flang-commits flang-commits at lists.llvm.org
Thu Nov 20 10:13:42 PST 2025


================
@@ -944,16 +954,23 @@ void ConstructInitializer(const Symbol &symbol,
   }
 }
 
-void ConvertToInitializers(
-    DataInitializations &inits, evaluate::ExpressionAnalyzer &exprAnalyzer) {
+void ConvertToInitializers(DataInitializations &inits,
+    evaluate::ExpressionAnalyzer &exprAnalyzer, bool processScopes) {
   // Process DATA-style component /initializers/ now, so that they appear as
   // default values in time for EQUIVALENCE processing in ProcessScopes.
   for (auto &[symbolPtr, initialization] : inits) {
     if (symbolPtr->owner().IsDerivedType()) {
       ConstructInitializer(*symbolPtr, initialization, exprAnalyzer);
     }
   }
-  if (ProcessScopes(
+  // FIXME: It is kinda weird that we need to repeatedly process the entire
+  // symbol table each time this is called by LegacyDataInitialization in
+  // ResolveNames. Could we do this once before the DataChecker and once after
+  // to combine initializations from Non-Legacy Initialization? Note, it passes
+  // all tests with just Running this code in
+  // CompileDataInitializationsIntoInitializers.
----------------
akuhlens wrote:

This comment needs to be removed or updated depending on which path we decide to take.


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


More information about the flang-commits mailing list