[flang-commits] [flang] [Flang] Revise the fix in PR #81807 to get specific procedure from a potential generic name. (PR #81544)

via flang-commits flang-commits at lists.llvm.org
Wed Feb 14 00:45:24 PST 2024


jeanPerier wrote:

> it seems `RankImpl` and `Corank` might also missing the `GenericDetails` case.

Thanks for pushing the reasoning here, yes, I think you are correct, this also needs to be updated if go that path. But I am not entirely sure this is the only and best path (see next comment).

```
module generic_iface
    interface somefunc
      module procedure  somefunc
    end interface
contains
  function somefunc()
    integer :: somefunc(2)
    somefunc = [1,2]
  end function
end module
subroutine bug(p)
  use generic_iface,proc=>somefunc
  procedure(proc) :: p
  print *, p()
end subroutine
```

Would otherwise crash in lowering because expr.getRank() is inconsistent with the rank that is later found when lowering `p()`.

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


More information about the flang-commits mailing list