Re: Scope of implied-do index



In article <1157046524.915018.69830@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
"Andy" <andyv@xxxxxxxxxxxxxx> writes:

This is done in the backend, which is well beyond parsing and
symbol resolution. It appears that gfortran needs to mangle the
do-variable of the implied-do.

Be careful. I can assure you that it's very tricky code to get right.
Don't forget to do it for FORALL statement constructs as well.

Yep. There are 2 or 3 outstanding bugs associated with implied-do.

integer, parameter :: i = 10
real :: x(10)
x = (/ (i, i=1, 10) /)

There was a problem with this example in g95. I've got it fixed now.


Yep. gfortran gets this wrong.

troutmask:sgk[205] gfc4x -o z kl.f90
In file kl.f90:3

x = (/ (i, i=1, 10) /)
1
Error: Cannot assign to a named constant at (1)
troutmask:sgk[206]

--
Steve
http://troutmask.apl.washington.edu/~kargl/
.