[Bug regression/38478] New: incorrect results for polynomial evaluation with optimisation/inline functions
bjg at gnu dot org
gcc-bugzilla@gcc.gnu.org
Wed Dec 10 17:22:00 GMT 2008
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
More information about the Gcc-bugs
mailing list