This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]