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: [Patch, fortran] PR20779 and PR20891 - allocation of STAT or specification variables in same call


On Sep 18, 2006, at 17:16:59, Paul Thomas wrote:

With or without the patch in place, gfortran (ifort) compile

   integer, allocatable :: x(:)
   integer :: i, j(2)
   allocate (x(kind(i)), stat=i)
   print *, size(x)
   allocate (x(size(j)), stat=j(1))
   print *, size(x)
 end

to give

          4
          2

as they should. ie. size(i) and kind(j) are just perfectly ordinary expressions. The patch was concerned to catch the non-standard case where STAT or a variable in the specification of other allocated arrays was being allocated in the same statement.

Paul,


I think I meant the expression

allocate (i(1), stat = j(kind(i)))

I got the problem case backwards. (Not that anybody would write code like that.) I was wondering whether the code that looks for "variable occurs in expression" handles expressions which do not depend on the value of a variable, and which are therefore allowed. (Or are they?)

-erik

--
Erik Schnetter <schnetter@cct.lsu.edu>

My email is as private as my paper mail.  I therefore support encrypting
and signing email messages.  Get my PGP key from www.keyserver.net.



Attachment: PGP.sig
Description: This is a digitally signed message part


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