diff --git a/flang/lib/Lower/ConvertExpr.cpp b/flang/lib/Lower/ConvertExpr.cpp --- a/flang/lib/Lower/ConvertExpr.cpp +++ b/flang/lib/Lower/ConvertExpr.cpp @@ -1625,6 +1625,9 @@ mlir::IndexType idxTy = builder.getIndexType(); Fortran::evaluate::ConstantSubscript size = Fortran::evaluate::GetSize(con.shape()); + if (size > std::numeric_limits::max()) + // llvm::SmallVector has limited size + TODO(getLoc(), "Creation of very large array constants"); fir::SequenceType::Shape shape(con.shape().begin(), con.shape().end()); mlir::Type eleTy; if constexpr (TC == Fortran::common::TypeCategory::Character)