------- Comment #4 from kargl at gcc dot gnu dot org 2010-05-31 18:33 ------- (In reply to comment #2) > > Note that fortran is case insensitive, ... > > Indeed, but I think the implied do loop should still go from 1 to 5. Note that > if I print 'i' after the loop I get 5. >
Of course it prints 5. The 'i' in the do-loop has the scope of the implied-do-loop. The 'I' in the program has the scope of the program. laptop:kargl[247] cat ui.f90 integer j(4) I=5 j = 42 j = (/(i,i=1,I-1)/) print '(A,I0,A,4(I0,1X))', 'I = ', I, ' j = ', j end laptop:kargl[248] gfc4x -o z -fdump-tree-original ui.f90 laptop:kargl[249] ./z I = 5 j = 0 134516008 0 0 The question becomes whether the 'I' in the implied-do-loop is being used uninitialized. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44354