Tobias Burnus
2018-10-12 11:28:55 UTC
Hello all,
"When an ALLOCATE statement is executed for an array with no
allocate-shape-spec-list, the bounds of source-expr determine
the bounds of the array." (F2018, 9.7.1.2 (6))
That seems to work fine for arrays which have an array descriptor.
However, as the current code shows, it fails for array constructors
where the lbound is zero instead of the expected one.
It turns out (PR67125) that functions results which don't use array
descriptors have the same problem as do stack/static allocated
array variables (PR87580).
I am not sure that my check for array descriptors is the best but
it seems to work and fixes the problem.
OK for the trunk?
Build and regtested on x86-64-linux.
Tobias
"When an ALLOCATE statement is executed for an array with no
allocate-shape-spec-list, the bounds of source-expr determine
the bounds of the array." (F2018, 9.7.1.2 (6))
That seems to work fine for arrays which have an array descriptor.
However, as the current code shows, it fails for array constructors
where the lbound is zero instead of the expected one.
It turns out (PR67125) that functions results which don't use array
descriptors have the same problem as do stack/static allocated
array variables (PR87580).
I am not sure that my check for array descriptors is the best but
it seems to work and fixes the problem.
OK for the trunk?
Build and regtested on x86-64-linux.
Tobias