spurious warning about uninitialized variable in implied do loop with -O1 option
Vivek Rao
vivekrao4@yahoo.com
Fri Oct 13 14:14:00 GMT 2006
For the program
function nsum(n) result(ires)
implicit none
integer, intent(in) :: n
integer :: i,ires
ires = sum((/(i,i=1,n)/))
end function nsum
compiled with
gfortran -c -O1 -Wall ximplied_do_gfortran.f90
using mingw gcc version 4.2.0 20061011 (experimental)
on Windows XP
there is a spurious warning message
ximplied_do_gfortran.f90: In function 'nsum':
ximplied_do_gfortran.f90:5: warning: 'i' is used
uninitialized in this function
There is no warning if -O1 is removed.
(Thanks for the rapid response to my "ICE caused by
-O3 and fbounds-check" message).
Vivek Rao
More information about the Fortran
mailing list