This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
"attempt to modify loop index" check in
- To: egcs-bugs at cygnus dot com
- Subject: "attempt to modify loop index" check in
- From: Luca BOTTURA <Luca dot Bottura at cern dot ch>
- Date: Tue, 28 Jul 1998 11:04 +0200
Hallo ! A bug in egcs ? The following code:
integer i
real a(4)
do i=1,3
write(6,*) (a(i),i=1,4)
enddo
end
compiles and executes without any error message, in spite of a modification
of the loop index i inside the implicit loop of the write statement.
Funny enough, the loop executes the correct number of times, in spite of the
fact that the value of i is continuously toggled between 5 (end value of
the implicit loop in the write statement) and 6 (after passing the index
increment)
Finally, the same code would not compile if instead of a "write", one would
use a "read".
Luca