This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/44354] incorrect output at run time
- From: "mikael at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 31 May 2010 21:39:36 -0000
- Subject: [Bug fortran/44354] incorrect output at run time
- References: <bug-44354-19262@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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