This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/19925] Implied do-loop in an initialization expression is broken
- From: "eedelman at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Jan 2006 00:03:16 -0000
- Subject: [Bug fortran/19925] Implied do-loop in an initialization expression is broken
- References: <bug-19925-8446@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from eedelman at gcc dot gnu dot org 2006-01-10 00:03 -------
(In reply to comment #5)
> The limit was rose but we should be able to do better.
Indeed. But the problem is not trivial. For a case like above, where the
array is a variable, we can translate it to
(program|function|subroutine) stuff
integer :: i_do
integer :: i(100001)
logical, save :: _i_initialized = .FALSE.
if (.not._i_initialized) then
i = (/ (i_do, i_do=1,100001) /)
_i_initialized = .TRUE.
end if
write (*,*) i
end (program|function|subroutine) stuff
(The _i_initialized variable is not needed in a main program, but it is in a
procedure.) This far it isn't a huge problem, but when 'i' is a PARAMETER it
gets more complicated. PARAMETERs are meant to be compile time constants. Let's
say we have e.g.
subroutine stuff
integer :: i_do
integer, parameter :: i(100001) = <whatever>
real(kind=i(1975)) :: a
...
end subroutine stuff
I can't at the moment think of a situation where we would need the entire array
at the stage of compilation, but at least we need to be able to access
individual elements.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19925