Compile-time simplification of INDEX()

the following legal code leads to an ICE:

program main
  integer, parameter :: ii(*) = index (["a"], "b")
end program

With nvfortran-22.5 I get:

NVFORTRAN-S-0000-Internal compiler error. size_of:bad dtype       0  (pgi-index.f90: 2)
NVFORTRAN-S-0000-Internal compiler error. size_of: bad dtype        0  (pgi-index.f90: 2)
NVFORTRAN-S-0066-Too few data constants in initialization statement (pgi-index.f90: 2)
  0 inform,   0 warnings,   3 severes, 0 fatal for main

As far as I can tell this is perfectly legal Fortran.


Thanks Harold. Looks similar to a few other reports we’ve had, but different enough to warrant it’s own report which I’ve filed under TPR #31995.