991108.12 | B | N | D. Anderson | Fortran | Fortran90 allocatable arrays |
Proposal for simple allocatable f90 arrays
(proposal follows description of actual implementation).
Here is a description of an extension as implemented by SGI:
F90 allows assumed shape arguments and pointers to describe
non-contiguous memory. A (runtime) descriptor contains address,
bounds and stride information - rank and element size is known
during compilation. The extent in each dimension is given by the
bounds in a DW_TAG_subrange_type, but the stride cannot be
represented in conventional dwarf. DW_AT_MIPS_stride was added as
an attribute of a DW_TAG_subrange_type to describe the
location of the stride.
Used in the MIPSpro 7.2 (7.2.1 etc) compilers.
If the stride is constant (ie: can be inferred from the type in the
usual manner) DW_AT_MIPS_stride is absent.
If DW_AT_MIPS_stride is present, the attribute contains a reference
to a DIE which describes the location holding the stride, and the
DW_AT_stride_size field of DW_TAG_array_type is ignored if
present. The value of the stride is the number of
4 byte words between
elements along that axis.
This applies to
a) Intrinsic types whose size is greater
or equal to 4bytes ie: real*4,integer*8
complex etc, but not character types.
b) Derived types (ie: structs) of any size,
unless all components are of type character.
There was also a DW_AT_MIPS_stride_byte
Created for f90 pointer and assumed shape
arrays.
Used in the MIPSpro 7.2 (7.2.1 etc) compilers.
A variant of DW_AT_MIPS_stride.
This stride is interpreted as a byte count.
Used for integer*1 and character arrays
and arrays of derived type
whose components are all character.
And a DW_AT_MIPS_stride_elem
Created for f90 pointer and assumed shape
arrays.
Used in the MIPSpro 7.2 (7.2.1 etc) compilers.
A variant of DW_AT_MIPS_stride.
This stride is interpreted as a byte-pair (2 byte) count.
Used for integer*2 arrays.
The proposal is slightly different: it proposes just
one new attribute.
Proposal:
1) DW_AT_stride_byte (new attr)
is allowed to appear on DW_TAG_subrange_type.
2) The value of the stride is the number of bytes between elements
along that axis.
3) If DW_AT_stride_byte is present on DW_TAG_subrange_type, then
DW_AT_stride_size of the DW_TAG_array_type is ignored
if present (on that axis).