This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Regression in LAPACK with -O3


I noticed that gfortran fails the LAPACK tests when compiled with -O3.
I have isolated (at least part of) the problem in the program given at the 
end of this mail. I have also been able to trace the problem between the 
8th and 9th of January (the right answer is 21):

[akira] test/fortran> ../gfortran/irun/bin/gfortran -v -O3 read_lapack.f
...
GNU F95 version 4.2.0 20060109 (experimental) (x86_64-unknown-linux-gnu)
...
[akira] test/fortran> a.out 
SEV 21     blah
 SEV 21     blah                                                                 
 SEV          10
[akira] test/fortran> ../gfortran/irun/bin/gfortran -O2 read_lapack.f
[akira] test/fortran> a.out
SEV 21     blah
 SEV 21     blah                                                                 
 SEV          21
[akira] test/fortran> ../gfortran/irun/bin/gfortran -v -O3 read_lapack.f
...
gcc version 4.2.0 20060108 (experimental)
...
[akira] test/fortran> a.out 
SEV 21     blah
 SEV 21     blah                                                                 
 SEV          21
[akira] test/fortran> ../gfortran/irun/bin/gfortran -O2 read_lapack.f
[akira] test/fortran> a.out
SEV 21     blah
 SEV 21     blah                                                                 
 SEV          21

TIA

Dominique

[karma] f90/bug% cat read_lapack.f90
CHARACTER*3        C3, PATH
CHARACTER*10       INTSTR
CHARACTER*80       LINE
CHARACTER          C1
DATA               INTSTR / '0123456789' /
   READ( *, FMT = '(A80)', END = 200 )LINE
   print *, LINE
   C3 = LINE( 1: 3 )
   LENP = LEN( LINE )
   I = 3
   ITMP = 0
   I1 = 0
  210    CONTINUE
   I = I + 1
   IF( I.GT.LENP ) THEN
      IF( I1.GT.0 ) THEN
	 GO TO 240
      ELSE
	 NTYPES = MAXT
	 GO TO 240
      END IF
   END IF
   IF( LINE( I: I ).NE.' ' .AND. LINE( I: I ).NE.',' ) THEN
      I1 = I
      C1 = LINE( I1: I1 )
      DO 220 K = 1, 10
	 IF( C1.EQ.INTSTR( K: K ) ) THEN
	    IC = K - 1
!                  print *, C1, K
	    GO TO 230
	 END IF
  220       CONTINUE
      WRITE( *, * ) 'error at ', I, LINE
      GO TO 200
  230       CONTINUE
      ITMP = 10*ITMP + IC
      GO TO 210
   ELSE IF( I1.GT.0 ) THEN
      GO TO 240
   ELSE
      GO TO 210
   END IF
  240    CONTINUE
   NTYPES = ITMP
   print *, C3, NTYPES
  200    CONTINUE
   END


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]