Nvfortran compiler internal error (nvfortran 23.7)

compiling :
subroutine problem
use ISO_C_BINDING
implicit none
interface choix
subroutine choix1(machin)
import :: C_INTPTR_T, C_PTR, C_INT32_t
implicit none
integer(C_INTPTR_T), intent(IN) :: machin
end
subroutine choix2(machin)
import :: C_INTPTR_T, C_PTR, C_INT32_t
implicit none
type(C_PTR), intent(IN) :: machin
end
end interface
type(C_PTR) :: cptr
integer(C_INT64_T) :: int64
call choix(transfer(int64,cptr))
end
result :

nvfortran -c problem3.F90
NVFORTRAN-S-0000-Internal compiler error. select_rtemp: bad ili 0 (problem3.F90: 18)
NVFORTRAN-S-0000-Internal compiler error. exp_call: ili ret type not cased 3 (problem3.F90: 18)

Hi mfvalin,

Thanks for the report. I was able to reproduce the error here and have filed TPR #34291. It appears to me to be an issue with using C_PTR in the transfer statement, but will have our engineers investigate.

-Mat

thank you for your quick answer,
i also reported the problem to AMD (4.1.0 aocc compilers)
as nvfortran’s cousin flang suffers from the same ailment

FYI, TPR #34291 should be fixed in our 24.1 release.

Fails in 23.11 but compiles with 24.1:

% nvfortran -c -V23.11 test2.F90
NVFORTRAN-S-0000-Internal compiler error. select_rtemp: bad ili       0  (test2.F90: 18)
NVFORTRAN-S-0000-Internal compiler error. exp_call: ili ret type not cased       3  (test2.F90: 18)
  0 inform,   0 warnings,   2 severes, 0 fatal for problem
% nvfortran -c -V24.1 test2.F90
%