next up previous contents
Next: Mapping of Derived Type Up: Pointers Previous: Pointers and Subprograms

Restrictions on Pointers and Targets

 

If, on invocation of a procedure P: (a) a dummy argument has the TARGET attribute, and (b) the corresponding actual argument has the TARGET attribute and is not an array section with a vector subscript (and therefore is an object A or a section of an array A), then the program is HPF-conforming only if:

  1. No remapping of the actual argument occurs during the call; or
  2. the remainder of program execution would be unaffected if
    1.   each pointer associated with any portion of A before the call were to acquire undefined pointer association status on entry to P and, if not reassigned during execution of P, were to be restored on exit to the pointer association status it had before entry.
    2.   each pointer associated with any portion of the dummy argument or with any portion of A during execution of P were to acquire undefined pointer association status on exit from P; and

Here is an example that illustrates the restrictions of this section:

      INTEGER, TARGET, DIMENSION (10) :: ACT
      INTEGER, POINTER, DIMENSON (:) :: POINTS_TO_ACT, POINTS_TO_DUM
!HPF$ DISTRIBUTE ACT(BLOCK)

      POINTS_TO_ACT => ACT
      CALL F(ACT)
      POINTS_TO_DUM(1) = 1             ! ILLEGAL

      CONTAINS
        SUBROUTINE F(DUM)
          INTEGER, TARGET, DIMENSION(10) :: DUM
        !HPF$ DISTRIBUTE DUM(CYCLIC)

          POINTS_TO_DUM => DUM
          POINTS_TO_ACT(1) = 1         ! ILLEGAL
        END SUBROUTINE
      END

The assignment to POINTS_TO_DUM(1) is illegal because it violates item 2b; the assignment to POINTS_TO_ACT(1) is illegal because it violates item 2a.


next up previous contents
Next: Mapping of Derived Type Up: Pointers Previous: Pointers and Subprograms