------- Comment #7 from domob at gcc dot gnu dot org  2008-10-18 08:27 -------
I'm having some difficulties seeing what the problem really is...  My
understanding of elemental procedures so far is that they should be more or
less equivalent to looping over the arguments and then performing them as the
standard seems to enforce the order and such is not important...  What do I
miss?  Is the following program supposed to swap the elements in a and b?

PROGRAM main
  IMPLICIT NONE
  INTEGER :: a(2)

  a = (/ 1, 2 /)
  CALL copy (a((/ 2, 1 /)), a)
  PRINT *, a

  STOP

CONTAINS

  ELEMENTAL SUBROUTINE copy (a, b)
    IMPLICIT NONE
    INTEGER, INTENT(IN) :: a
    INTEGER, INTENT(OUT) :: b

    b = a
  END SUBROUTINE copy

END PROGRAM main

This prints "2 2" at the moment, which seems quite reasonable to me; or does
the standard enforce it should print "2 1"?  If so, where can I find the
details about this (i.e. need temporaries only for INTENT(IN) arguments that
are TARGETS or also passed to INTENT(*OUT) parameters, or also for
INTENT(INOUT) ones...)?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35681

Reply via email to