Bug 20026 - Weird optimization affects cpu200/178.galgel testing
Summary: Weird optimization affects cpu200/178.galgel testing
Status: RESOLVED DUPLICATE of bug 323
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
Depends on:
Reported: 2005-02-17 13:26 UTC by Denis
Modified: 2005-07-23 22:49 UTC (History)
2 users (show)

See Also:
Host: i586-suse-linux
Target: i586-suse-linux
Build: i586-suse-linux
Known to work:
Known to fail:
Last reconfirmed:

sample for error reproducing (478 bytes, text/plain)
2005-02-17 13:28 UTC, Denis

Note You need to log in before you can comment on or make changes to this bug.
Description Denis 2005-02-17 13:26:56 UTC
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" 
         write(*,*) "Bad!!!" 
         write(*,*) "A=",A 
         write(*,*) "C=",C 
      END IF 
      FUNCTION foo( A, B ) 
      REAL*8 foo 
      REAL*8   A, B 
      foo = A + B 
>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
Comment 1 Denis 2005-02-17 13:28:36 UTC
Created attachment 8214 [details]
sample for error reproducing
Comment 2 Andrew Pinski 2005-02-17 13:37:25 UTC
The problem is that on x86, we use the excessive precision, see PR 323.
This is a dup of bug 323.

*** This bug has been marked as a duplicate of 323 ***