[Patch, fortran] PR20779 and PR20891 - allocation of STAT or specification variables in same call
Erik Schnetter
schnetter@cct.lsu.edu
Tue Sep 19 01:12:00 GMT 2006
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20060919/2244fe91/attachment.sig>
More information about the Fortran
mailing list