When compiling the code below with '-O -Wuninitialized', I get spurious
warnings:
piekana:~$ cat gforttest.f90
program runoptf90
implicit none
real :: x(1)
call simulated_annealing (x)
contains
subroutine simulated_annealing (xmin)
real, intent(inout) :: xmin(:)
real :: x(size(xmin))
real :: r(size(x))
xmin = r
end subroutine simulated_annealing
end program runoptf90
piekana:~$ gfortran42 -O -Wuninitialized gforttest.f90
gforttest.f90: In function 'MAIN__':
gforttest.f90:6: warning: 'ubound.6' is used uninitialized in this function
piekana:~$ gfortran42 --version
GNU Fortran 95 (GCC) 4.2.0 20060729 (experimental)
--
Summary: Spurious warning: 'ubound.6' is used uninitialized in
this function
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: erik dot edelmann at iki dot fi
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28660