[flang-commits] [clang] [flang] [llvm] [flang] Add -finit-local= to initialize automatic variables (PR #216164)

Daniel Chen via flang-commits flang-commits at lists.llvm.org
Tue Sep 1 07:56:29 PDT 2026


================
@@ -1670,6 +1670,8 @@ fir::getTypeSizeAndAlignment(mlir::Location loc, mlir::Type ty,
           llvm::alignTo(size, compAlign) + llvm::alignTo(compSize, compAlign);
       align = std::max(align, compAlign);
     }
+    // Include tail padding so the size matches the allocation size.
+    size = llvm::alignTo(size, align);
----------------
DanielCChen wrote:

@MattPD The latest Commit f002befec2efd8fa7c527fc630120c9c2092443b is to address this comment. Could you please check if it satisfies the request? If so, I will pull the change to `FIRType.cpp` into a separate PR as we discussed.

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


More information about the flang-commits mailing list