23.5 Regression: Bogus "Recursive subroutine or function call"

The following code is rejected by 23.5, but works with <= 23.3:

module mymod
  implicit none
contains
  subroutine get_inventory (file)
    character(len=*) ,intent(in) :: file
  end subroutine get_inventory
end

MODULE pgibug
  use mymod, only: get_inv_grib => get_inventory ! renamed!
  implicit none
  interface get_inventory
     module procedure get_inv_gen
  end interface
contains
  subroutine get_inv_gen  (file, stat)
    character(len=*) ,intent(in)  :: file
    integer, optional ,intent(out) :: stat ! recursion???
!   integer           ,intent(out) :: stat ! different resolution bug
    call get_inv_grib  (file)
  end subroutine get_inv_gen
end

This gives:

NVFORTRAN-S-0088-Recursive subroutine or function call of get_inv_gen (pgibug.f90: 20)
  0 inform,   0 warnings,   1 severes, 0 fatal for get_inv_gen

Interestingly, changing the comment such that the dummy argument declaration is non-optional,
I instead get:

NVFORTRAN-S-0155-Could not resolve generic procedure get_inventory (pgibug.f90: 20)
  0 inform,   0 warnings,   1 severes, 0 fatal for get_inv_gen

:-(

Thanks for the report anlauf.

I filed a problem report, TPR #33692, and have asked engineering to investigate.

-Mat

Hi anlauf,

Engineer has let me know that TPR #33692 was fixed in our 23.7 release.

% nvfortran -V23.5 -c test2.f90
NVFORTRAN-S-0088-Recursive subroutine or function call of get_inv_gen (test2.f90: 20)
  0 inform,   0 warnings,   1 severes, 0 fatal for get_inv_gen
% nvfortran -V23.7 -c test2.f90
%

-Mat