With gfortran 20050129 I get a testsuite failure at -O2 that I don't see at - O0. The failure is in the CGT tests in ctest.in: CGT: General tridiagonal Matrix types (1-6 have specified condition numbers): 1. Diagonal 7. Random, unspecified CNDNUM 2. Random, CNDNUM = 2 8. First column zero 3. Random, CNDNUM = sqrt(0.1/EPS) 9. Last column zero 4. Random, CNDNUM = 0.1/EPS 10. Last n/2 columns zero 5. Scaled near underflow 11. Scaled near underflow 6. Scaled near overflow 12. Scaled near overflow Test ratios: 1: norm( L * U - A ) / ( N * norm(A) * EPS ) 2: norm( B - A * X ) / ( norm(A) * norm(X) * EPS ) 3: norm( X - XACT ) / ( norm(XACT) * CNDNUM * EPS ) 4: norm( X - XACT ) / ( norm(XACT) * CNDNUM * EPS ), refined 5: norm( X - XACT ) / ( norm(XACT) * (error bound) ) 6: (backward error) / EPS 7: RCOND * CNDNUM - 1.0 Messages: NORM ='O', N = 1, type 5, test( 7) = 0.16777E+08 NORM ='I', N = 1, type 5, test( 7) = 0.16777E+08 TRANS='N', N = 1, NRHS= 1, type 5, test( 3) = I have reduced it to the miscompilation of routine cgtts2.f at -O2. I have isolated a single failing case, but if I try to change the routine the problem evaporates. Attached is: - driv.f: a small driver program - cgtts2.f: the LAPACK routine with the problem. To reproduce: gfortran -o pass.exe -O0 driv.f cgtts2.f gfortran -o fail.exe -O0 driv.f cgtts2.f ./pass B(1,1) = ( 4.0564819E+31, 0.000000 ) ./fail At line 15 of file driv.f Internal Error: printf is broken B(1,1) = ( Note: The internal error is PR 19363

Created attachment 8099 [details] driv.f: test driver driv.f is driver routine

Created attachment 8100 [details] cgtts2.f is LAPACK routine that is miscompiled cgtts2.f is LAPACK routine that is miscompiled

At -O0 on powerpc-darwin I get: B(1,1) = ( +Infinity, NaN)

This goes away when we set flag_complex_divide_method = 1 in toplev.c - overflow in complex division - which is consistent with the magnitude of the inputs. PR 18902 again.

Can this be closed with the recent change of default complex divide algorithm?

Fixed by changes to complex divide algorithm. See comment #46 on PR5900 for LAPACK testsuite results at -O2.