public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug regression/38478]  New: incorrect results for polynomial evaluation with optimisation/inline functions
@ 2008-12-10 17:22 bjg at gnu dot org
  2008-12-10 17:23 ` [Bug regression/38478] " bjg at gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: bjg at gnu dot org @ 2008-12-10 17:22 UTC (permalink / raw)
  To: gcc-bugs

The attached program produces incorrect results in gcc-4.3.2 with -O2. (The
results are correct at -O0 when inline functions are not used).

The code evaluates a complex polynomial in Horner form via an inline function.
It is part of the test suite of gsl-1.11 (GNU Scientific Library).  I have
examined the code and believe it is numerically correct.  For comparison, the
problem does not occur in gcc-4.3.0.

$ /opt/gcc-4.3.2/bin/gcc -v      
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: /home/bjg/ftp/gcc-4.3.2/configure --prefix=/opt/gcc-4.3.2
Thread model: posix
gcc version 4.3.2 (GCC) 

$ /opt/gcc-4.3.2/bin/gcc -O0 -Wall testcase.c 
$ ./a.out 
Completed [10/10]

$ /opt/gcc-4.3.2/bin/gcc -O2 -Wall testcase.c
$ ./a.out 
FAIL: y.real, gsl_complex_poly_complex_eval ({-2.31 + 0.44i, 4.21 - 3.19i, 0.93
+ 1.04i, -0.42 + 0.68i}, 0.49 + 0.95i) (-2.31000000000000005 observed vs
1.82462012000000007 expected) [9]
FAIL: y.imag, gsl_complex_poly_complex_eval ({-2.31 + 0.44i, 4.21 - 3.19i, 0.93
+ 1.04i, -0.42 + 0.68i}, 0.49 + 0.95i) (0.440000000000000002 observed vs
2.30389411999999982 expected) [10]


-- 
           Summary: incorrect results for polynomial evaluation with
                    optimisation/inline functions
           Product: gcc
           Version: 4.3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: regression
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bjg at gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-12-10 18:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-10 17:22 [Bug regression/38478] New: incorrect results for polynomial evaluation with optimisation/inline functions bjg at gnu dot org
2008-12-10 17:23 ` [Bug regression/38478] " bjg at gnu dot org
2008-12-10 18:16 ` [Bug tree-optimization/38478] [4.3 Regression] " rguenth at gcc dot gnu dot org
2008-12-10 18:37 ` rguenth at gcc dot gnu dot org
2008-12-10 18:45 ` rguenth at gcc dot gnu dot org
2008-12-10 18:47 ` rguenth at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).