[Bug fortran/20026] New: Weird optimization affects cpu200/178.galgel testing

denis dot nagorny at intel dot com gcc-bugzilla@gcc.gnu.org
Thu Feb 17 17:10:00 GMT 2005


LAPACK tries to determine behavior of present double pre- 
precision numbers. One of used methods is based on property  
that (on IA32) 9.0071992547400992E+015 + 1 will be the same 
9.0071992547400992E+015, but 9.0071992547400992E+015 + 2 will  
be differ.  
This sample demonstrates that any level of optimization in  
gfortran version 4.0.0 20050215 breaks this functionality. 
Due to this feature it's impossible now to use 178.galgel test from 
cpu2000 testsuite. 
 
Please compile following sample (I'll attach them also) with and without option 
-O1. You'll obtain "Good" without optimization and "Bad" with -O1. 
!!*************** 
      REAL*8   A, B, C  
      REAL*8   foo 
 
      A = 9.0071992547400992E+015 
      B = 1 
      C = foo( A, B ) 
          
      IF( C.EQ.A ) THEN 
         write(*,*) "Good" 
      ELSE 
         write(*,*) "Bad!!!" 
         write(*,*) "A=",A 
         write(*,*) "C=",C 
      END IF 
      END 
!!****************************** 
      FUNCTION foo( A, B ) 
      REAL*8 foo 
      REAL*8   A, B 
      foo = A + B 
      RETURN 
      END 
!!********************* 
>gfortran -v 
Using built-in specs. 
Target: i586-suse-linux 
Configured with: ../src/gcc/configure --enable-threads=posix 
--prefix=/users/xxxxx/work/gcc40/real --disable-checking --enable-libgcj 
--with-system-zlib --enable-shared --enable-__cxa_atexit i586-suse-linux 
Thread model: posix 
gcc version 4.0.0 20050215 (experimental

-- 
           Summary: Weird optimization affects cpu200/178.galgel testing
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: denis dot nagorny at intel dot com
                CC: gcc-bugs at gcc dot gnu dot org,grigory dot zagorodnev
                    at intel dot com
 GCC build triplet: i586-suse-linux
  GCC host triplet: i586-suse-linux
GCC target triplet: i586-suse-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20026



More information about the Gcc-bugs mailing list