I’ve encountered an internal compiler error for what seems to be valid according to all other major compilers. The issue is encountered when trying to select along an array axis for constant data
A MWE is:
program check
implicit none
integer, parameter :: N = 5
integer, parameter :: V1(N,4) = reshape((/0, 0, 0, 1, &
0, 0, 1, 1, &
0, 0, 1, -1, &
4, -1, 0, -1, &
2, -2, 0, 1/), &
shape(V1),order=(/2,1/))
integer, parameter :: V1COL(N) = V1(:,2)
write(*,*) V1COL
end program check
The expected result is:
0 0 0 -1 -2
For nvfortran, we get the following:
NVFORTRAN-S-0000-Internal compiler error. initialization expression: invalid array subscripts
5 (/app/example.f90: 12)
0 inform, 0 warnings, 1 severes, 0 fatal for check
Compiler returned: 2
I’ve tried messing around with different ways of specifying the array subscripts to try and track if it was an issue of how things were specified in its mind, but I haven’t come across something that satisfies.
The attached Godbolt link has a conformance view for other major compilers: link
Thanks for your help