[flang-commits] [flang] [flang] Correctly prepare allocatable runtime call arguments (PR #138727)

via flang-commits flang-commits at lists.llvm.org
Wed May 7 01:41:46 PDT 2025


================
@@ -210,15 +210,14 @@ static bool hasExplicitLowerBounds(mlir::Value shape) {
 static std::pair<mlir::Type, mlir::Value> updateDeclareInputTypeWithVolatility(
     mlir::Type inputType, mlir::Value memref, mlir::OpBuilder &builder,
     fir::FortranVariableFlagsAttr fortran_attrs) {
-  if (mlir::isa<fir::BoxType, fir::ReferenceType>(inputType) && fortran_attrs &&
+  if (fortran_attrs &&
       bitEnumContainsAny(fortran_attrs.getFlags(),
                          fir::FortranVariableFlagsEnum::fortran_volatile)) {
     const bool isPointer = bitEnumContainsAny(
         fortran_attrs.getFlags(), fir::FortranVariableFlagsEnum::pointer);
     auto updateType = [&](auto t) {
       using FIRT = decltype(t);
-      // If an entity is a pointer, the entity it points to is volatile, as far
-      // as consumers of the pointer are concerned.
+      // A volatile pointer's pointee is volatile.
----------------
jeanPerier wrote:

Unrelated to your patch, but since you updated the comment :), why doesn't this also apply to the target data of an allocatable descriptor?

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


More information about the flang-commits mailing list