[flang-commits] [flang] [Flang] Add partial support for lowering procedure pointer assignment. (PR #70461)

via flang-commits flang-commits at lists.llvm.org
Tue Nov 14 06:46:51 PST 2023


================
@@ -98,6 +99,10 @@ hlfir::EntityWithAttributes Fortran::lower::convertProcedureDesignatorToHLFIR(
     mlir::Location loc, Fortran::lower::AbstractConverter &converter,
     const Fortran::evaluate::ProcedureDesignator &proc,
     Fortran::lower::SymMap &symMap, Fortran::lower::StatementContext &stmtCtx) {
+  if (std::optional<fir::FortranVariableOpInterface> varDef =
+          symMap.lookupVariableDefinition(*proc.GetSymbol()))
----------------
jeanPerier wrote:

Actually, you should only do this bypass if `proc.GetSymbol()` is not a nullptr (it may be if the procedure reference is an unrestricted intrinsic).

e.g. the following will crash with HLFIR enabled after this patch:

```
  intrinsic iabs
  call test(iabs)
end
```

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


More information about the flang-commits mailing list