[flang-commits] [flang] [Flang] Do not provide a shape operand for box addresses (PR #157732)

via flang-commits flang-commits at lists.llvm.org
Tue Sep 16 06:25:56 PDT 2025


jeanPerier wrote:

> @jeanPerier any other thoughts on this?

Yes, I think it is best to properly create the box in `Fortran::lower::mapSymbolAttributes`.

I would suggest adding the following right below [this line](https://github.com/llvm/llvm-project/blob/666e4313ebc03587f27774139ad8f780bac15c3e/flang/lib/Lower/ConvertVariable.cpp#L2442):

```
if (isUnusedEntryDummy && llvm::isa<fir::BaseBoxType>(converter.genType(var)))
  if (genUnusedEntryPointBox())
    return;
```

Deriving https://github.com/llvm/llvm-project/commit/1e1f60c605a9b1c803f3bbb1a1339c9bb1af4e34 example, I could not quickly come with a problematic example that would break/crash with your solution, but I am a bit concerned some of the lowering code may not be happy to see a fir.ref<fir.class> for a Symbol that is not a POINTER/ALLOCATABLE since this is never the case.

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


More information about the flang-commits mailing list