Question on variable_size and function-at-a-time
Toon Moene
toon@moene.indiv.nluug.nl
Wed Apr 14 21:10:00 GMT 2004
Robert Dewar wrote:
> Geoff Keating wrote:
>
>> I believe it's wrong that we use SAVE_EXPR for array sizes for C. We
>> should instead create temporary variables to hold the size
>> declarations, and set them in the appropriate point in the instruction
>> stream.
>
> I agree. In fact my feeling is that we should get rid of the use
> of SAVE_EXPR wherever possible.
That's OK with me, as long as we have a way of expressing that in
SUBROUTINE SUB(A, N)
DIMENSION A(N)
N = N + 1
DO I = 1, N - 1
PRINT*, A(I)
END DO
PRINT*, N
END
still works correctly and both
1. Prints A(1 .. original N)
2. Prints original N + 1 at the end.
Hope this helps,
--
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
GNU Fortran 95: http://gcc.gnu.org/fortran/ (under construction)
More information about the Gcc
mailing list