From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22833 invoked by alias); 17 Feb 2005 13:27:29 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 22337 invoked by uid 48); 17 Feb 2005 13:27:02 -0000 Date: Thu, 17 Feb 2005 17:10:00 -0000 From: "denis dot nagorny at intel dot com" To: gcc-bugs@gcc.gnu.org Message-ID: <20050217132656.20026.denis.nagorny@intel.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug fortran/20026] New: Weird optimization affects cpu200/178.galgel testing X-Bugzilla-Reason: CC X-SW-Source: 2005-02/txt/msg01939.txt.bz2 List-Id: 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