------- Comment #17 from dir at lanl dot gov 2007-06-21 16:29 ------- I have attached version that generates no warnings with gfortran or g95. As I reduced, it the bug changed - that is the problem with optmization bugs - they are hard to trap. Anyway there is still a bug for some compilers. gfortran on the Macintosh and Linux are Ok. g77 is happy and gets the correct answer -
[dranta:~/tests] dir% g77 -o g95Test02 g95Test02.f [dranta:~/tests] dir% g95Test02 1 lower triangular matrix with 3 rows row 1 0.8000E+01 row 2 0.9000E+01 0.1000E+02 row 3 0.1100E+02 0.1200E+02 0.1300E+02 iprec = 1 1 lower triangular matrix with 3 rows row 1 0.1600E+02 row 2 0.9000E+01 0.2000E+02 row 3 0.1100E+02 0.1200E+02 0.2600E+02 g95 cannot decide which wrong answer it likes - [dranta:~/tests] dir% g95 -Wall -g -o g95Test02 g95Test02.f [dranta:~/tests] dir% g95Test02 1 lower triangular matrix with 3 rows row 1 -0.2000E+01 row 2 0.1000E+01 0.2000E+01 row 3 0.3000E+01 0.4000E+01 0.5000E+01 iprec = 1 1 lower triangular matrix with 3 rows row 1 -0.3999E+01 row 2 0.1000E+01 0.4000E+01 row 3 0.3000E+01 0.4000E+01 0.1000E+02 [dranta:~/tests] dir% g95 -Wall -O3 -o g95Test02 g95Test02.f [dranta:~/tests] dir% g95Test02 1 lower triangular matrix with 3 rows row 1 0.8000E+01 row 2 0.9000E+01 0.1000E+02 row 3 0.1100E+02 0.1200E+02 0.1300E+02 iprec = 1 1 lower triangular matrix with 3 rows row 1 0.8000E+01 row 2 0.9000E+01 0.1000E+02 row 3 0.1100E+02 0.1200E+02 0.1300E+02 gfortran (i386-pc-mingw32) on windows now gets the wrong answer with -O3 - [EMAIL PROTECTED] ~/tests $ gfortran -g -o g95Test02 g95Test02.f [EMAIL PROTECTED] ~/tests $ g95Test02 1 lower triangular matrix with 3 rows row 1 0.8000E+01 row 2 0.9000E+01 0.1000E+02 row 3 0.1100E+02 0.1200E+02 0.1300E+02 iprec = 1 1 lower triangular matrix with 3 rows row 1 0.1600E+02 row 2 0.9000E+01 0.2000E+02 row 3 0.1100E+02 0.1200E+02 0.2600E+02 [EMAIL PROTECTED] ~/tests $ gfortran -O3 -o g95Test02 g95Test02.f [EMAIL PROTECTED] ~/tests $ g95Test02 1 lower triangular matrix with 3 rows row 1 0.0000E+00 row 2 0.1000E+01 0.2000E+01 row 3 0.3000E+01 0.4000E+01 0.5000E+01 iprec = 1 1 lower triangular matrix with 3 rows row 1 0.0000E+00 row 2 0.1000E+01 0.4000E+01 row 3 0.3000E+01 0.4000E+01 0.1000E+02 [EMAIL PROTECTED] ~/tests $ gfortran --v Using built-in specs. Target: i386-pc-mingw32 Configured with: ../trunk/configure --prefix=/mingw --enable-languages=c,fortran --with-gmp=/home/coudert/local --disable-nls --with-ld=/mingw/bin/ld --with-as=/mingw/bin/as --disable-werror --enable-bootstrap --enable-threads --build=i386-pc-mingw32 --disable-shared --enable-libgomp Thread model: win32 gcc version 4.3.0 20070522 (experimental) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32393