This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


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

"attempt to modify loop index" check in


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



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