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]
Other format: [Raw text]

[Bug fortran/44354] incorrect output at run time



------- Comment #10 from mikael at gcc dot gnu dot org  2010-05-31 21:39 -------
(In reply to comment #6)
>       integer j(5)
>       I=5
>       j = 42
>       do i = 1, I
>          j(i) = i
>       end do
>       print '(A,I0,A,5(I0,1X))', 'I = ', I, ' j = ', j
>       end
> 
> because in the above 'i' and 'I' are in the same scoping unit.
> If you write 'i = 5; j = [(i,i=1,I)]' then the 'i' here is in
> a different scoping unit.  I agree that the scalar-int-expr
> '1' and 'I' need to be evaluated to establish the the loop
> start and stop values.  The question again based on scoping
> unit is whether 'I' is uninitialized.

Even if 'i' and 'I' are in different scoping unit, there is nothing unitialized
:
('i' is the external 'I', and 'ii' the internal one)

       integer j(5)
       I=5
       j = 42
       do ii = 1, I
          j(ii) = ii
       end do
       print '(A,I0,A,5(I0,1X))', 'I = ', I, ' j = ', j
       end


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44354


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