Steve,
for unknown reasons I cannot reply to your mail on gmane,
so trying directly via mailing list.
I tried your patch, and it works on the supplied testcases.
However, there is a scoping issue for the declaration of the
index variable, as can be seen by the following variation:
program foo
use iso_fortran_env, only : k => real_kinds
implicit none
integer, parameter :: n = size(k)
integer(8) :: i
!!$ integer, parameter :: &
!!$ & p(n) = [(precision(real(1.,k(i))), integer :: i = 1, n)]
integer, parameter :: &
& q(n) = [(kind(i), integer(2) :: i = 1, n)]
integer, parameter :: &
& r(n) = [(storage_size(i), integer(1) :: i = 1, n)]
!!$ print *, p
print *, q
print *, r
end program foo
After your patch, gfortran prints:
8 8 8 8
64 64 64 64
This suggests that the integer kind is taken from the host decl,
which is kind=8, and not the local one (2 or 1).
Crayftn (which chokes on your original testcase):
3*2
3*8
This is what I expect.
Intel doesn't accept storage_size() here, which is a bug.
Commenting the uses of array r, I then get:
2 2 2
At least this agrees with Cray.
Can you have another look at this?
Thanks so far for you patch!
Harald