Nvfortran 23.11 internal compiler error

nvfortran 23.11 cannot compile this source file:

https://raw.githubusercontent.com/west-code-development/West/master/Libraries/Forpy/forpy_mod.f90

$ nvfortran -fast -Mpreprocess -c forpy_mod.f90
NVFORTRAN-F-0000-Internal compiler error. ad_instr(): missing last instruction       0  (forpy_mod.f90: 3161)
NVFORTRAN/x86-64 Linux 23.11-0: compilation aborted

$ nvfortran -O2 -Mpreprocess -c forpy_mod.f90
NVFORTRAN-F-0000-Internal compiler error. ad_instr(): missing last instruction       0  (forpy_mod.f90: 3161)
NVFORTRAN/x86-64 Linux 23.11-0: compilation aborted

$ nvfortran -O1 -Mpreprocess -c forpy_mod.f90
# no error

Hi victor.wz.yu.1012,

Thanks for the report and the example code. I was able to reproduce the error here and have filed an issue report, TPR #34768.

It appears to be a new regression in 23.11 as the code seems to compile correctly in 23.9 and earlier compilers. Reducing the optimization level to “-O1” also seems to work around the error.

-Mat

Thank you, Mat.

Yes, this is a new problem that didn’t happen with 23.9 or earlier versions. Hopefully it can be fixed in the next release.

Thanks,
Victor

Hi Victor,

Engineering let me know they tracked down the issue and determined that it’s a problem with the inliner, so another work around is to add the flag “-Mnoinline”.

-Mat