This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: question about elemental subroutines
- From: Paul dot Thomas at jet dot uk (Paul Thomas)
- To: <fortran at gcc dot gnu dot org>
- Date: Mon, 24 Apr 2006 22:36:00 +0100
- Subject: Re: question about elemental subroutines
What I tried to ensure in the elemental subroutine dependency checking is that:
call nonassign (x(2:3), x(1:2)) returns the same as
call nonassign (x(3:2:-1), x(2:1:-1)),
when one argument is OUT/INOUT and the other is IN. In the particular example under discussion, this is not ensured unless the argument is INOUT because the subroutine makes use of the incoming value of that argument. Were unititialized variables detected, the illegal cases where an attempt is made to use a variable that is undefined would be prevented. However, the patch to do this was not accepted.
In light of this discussion, I will reread the standard and check that I have done the right thing.
call nonassign (x(2), x(1))
call nonassign (x(3), x(2))
and
call nonassign (x(2), x(1))
call nonassign (x(3), x(2))
must, of course, give different results; whether intentionally or not!
Paul