J3/05-149r1 To: J3 From: Bill Long/HPC Subject: Sequence Pointers and dummy arguments. Date: 8-Feb-2005 Number: Title: sequence pointers Submitted By: J3 Status: For Consideration References: J3/04-132 Basic Functionality: -------------------- Provide a method to indicate that the target of a pointer or an actual argument is contiguous. Rationale: ---------- Many unnecessary operations happen because compilers cannot determine that a data item occupies contiguous memory. For example, contiguous memory is needed to pass an array to a procedure with an implicit interface. Certain optimizations are possible if the compiler knows that the memory stride for the left-most subscript is 1, or if a whole array occupies a contiguous memory block. Thus, the mere use of pointers often results in substantially suboptimal code. If the compiler knew that the pointer was constrained to point to contiguous memory, very much better code could be generated. Similar optimization problems exist for assumed-shape dummy arguments. Estimated Impact: the effort was estimated as 5 on the John Reid scale at M167. ----------------- Detailed Specification: ----------------------- Provide a declaration attribute, SEQUENCE, that specifies that the pointer being declared will only be associated with a target occupying a storage sequence or that an assumed-shape dummy argument is associated with a contiguous actual argument. For example, real, pointer, sequence :: sptr(:) real, sequence, dimension(:,:) :: d If the variable is a dummy argument with the pointer attribute, the target of the associated actual argument shall be a storage sequence. If the variable is an assumed-shape array, the associated actual argument shall be a storage sequence or a pointer associated with a target that is a storage sequence. A corresponding SEQUENCE :: statement is also provided. The attribute could be spelled CONTIGUOUS instead of SEQUENCE. History: J3/04-132