That annoying dnrm2.f failure on i386

Toon Moene toon@moene.indiv.nluug.nl
Wed Feb 18 14:54:00 GMT 1998


[ ... patch for dnrm2.f failure on ix86's - hurray ! ... ]

>  Unfortunately, dnrm2.f still fails. This appears to be
>  due to the fact that it reads uninitialized variables.
>  Can someone who can actually parse Fortran tell me how
>  the test case should be fixed?

/usr/test/bin/g77 -Wuninitialized -O2 -S -v dnrm2.f
Reading specs from  
/usr/test/lib/gcc-lib/m68k-next-nextstep3/egcs-2.91.07/specs
gcc version egcs-2.91.07 980205 (gcc-2.8.0 release)
 /usr/test/lib/gcc-lib/m68k-next-nextstep3/egcs-2.91.07/f771  
dnrm2.f -fset-g77-defaults -quiet -dumpbase dnrm2.f -O2  
-Wuninitialized -version -fversion -o dnrm2.s
GNU F77 version egcs-2.91.07 980205 (gcc-2.8.0 release)  
(m68k-next-nextstep3) compiled by GNU C version egcs-2.91.07 980205  
(gcc-2.8.0 release).
GNU Fortran Front End version 0.5.22-19970929
dnrm2.f: In function `dnrm2':
dnrm2.f:3: warning: `xmax' might be used uninitialized in this function

One way of testing whether this is the real problem - short of  
implementing a full trap-on-uninitialised-variables option - is to  
initialise xmax as follows:

Add a line

      xmax = -1.0e38

right before the line

      if(n .gt. 0 .and. incx.gt.0) go to 10

i.e. the first `executable code'.

HTH,
Toon.



More information about the Gcc mailing list