This is not bug 5035.

[EMAIL PROTECTED] Bug2]$ cat bb.f90 

subroutine SetupRadii(N)
integer,intent(in)::N
integer::i,j
write(*,*)(/(i,i=1,N)/)
write(*,*)(/(j,j=1,5)/)
end subroutine SetupRadii

[EMAIL PROTECTED] Bug2]$ gfortran -Wall -O1 -v -c bb.f90
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ./configure --disable-multilib --enable-languages=fortran
Thread model: posix
gcc version 4.2.0 20070228 (prerelease)
 /usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.2.0/f951 bb.f90 -quiet
-dumpbase bb.f90 -mtune=generic -auxbase bb -O1 -Wall -version -I
/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.2.0/finclude -o /tmp/cc30FF7z.s
GNU F95 version 4.2.0 20070228 (prerelease) (x86_64-unknown-linux-gnu)
        compiled by GNU C version 4.2.0 20070228 (prerelease).
GGC heuristics: --param ggc-min-expand=89 --param ggc-min-heapsize=112046
bb.f90: In function ‘setupradii’:
bb.f90:5: warning: ‘i’ is used uninitialized in this function
 as --traditional-format -V -Qy -o bb.o /tmp/cc30FF7z.s
GNU assembler version 2.17 (x86_64-linux-gnu) using BFD version 2.17 Debian
GNU/Linux



For those that missed it:
bb.f90: In function ‘setupradii’:
bb.f90:5: warning: ‘i’ is used uninitialized in this function

It seems that whatever generates this warning is not fully aware of implied do
constructs.  Note that no warning is generated for j, for which the bounds are
known at compile time.  The warning is still generated when N is a local
variable rather than an argument.

I haven't tried with gcc younger than my two month old build.


-- 
           Summary: False warning for variable used in 'automatic' implied
                    do loop
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: terry at chem dot gu dot se
  GCC host triplet: x86_64-unknown-linux-gnu


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

Reply via email to