[flang-commits] [flang] [Flang]: Lowering reference to functions that return a procedure pointer (PR #78194)

via flang-commits flang-commits at lists.llvm.org
Fri Jan 19 02:49:07 PST 2024


jeanPerier wrote:

It seems to be legal to use procedure pointer result in ASSOCIATED, this currently crashes:

```
 interface
   function foo()
     procedure(), pointer :: foo
   end function
 end interface
 print *, associated(foo())
 end
```

So either the fir.boxproc results needs to be placed in a storage after the call so that code that expects to get pointers works, or the ASSOCIATED lowering should accept fir.boxproc as first argument too.

https://github.com/llvm/llvm-project/blob/a90347ecc7e32c25a3b3820723f8405369f3abdc/flang/lib/Optimizer/Builder/IntrinsicCall.cpp#L2180

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


More information about the flang-commits mailing list