This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: GCC options and floating-point correctness (benchmarks)
Scott Robert Ladd <coyote@coyotegulch.com> writes:
> Joseph S. Myers wrote:
>> What if -ffloat-store is used in alternative to those? It doesn't
>> actually work as far as causing conformance (e.g., casts to same type
>> still get discarded rather than reducing precision), but it is supposed to
>> help.
>
> -ffloat-store and -mieee-fp don't change the results.
This is contradicted by my results.
>From /proc/cpuinfo
model name : Intel(R) XEON(TM) CPU 2.00GHz
gcc is gcc-3.2
wget http://www.netlib.org/paranoia/paranoia.c
gcc -O2 -ffloat-store paranoia.c -lm
./a.out
The number of DEFECTs discovered = 1.
The number of FLAWs discovered = 1.
Without -ffloat-store:
gcc -O2 paranoia.c -lm
The number of FAILUREs encountered = 2.
The number of SERIOUS DEFECTs discovered = 3.
The number of DEFECTs discovered = 4.
The number of FLAWs discovered = 2.
With -mieee-fp:
gcc -O2 -mieee-fp paranoia.c -lm
The number of FAILUREs encountered = 2.
The number of SERIOUS DEFECTs discovered = 3.
The number of DEFECTs discovered = 4.
The number of FLAWs discovered = 2.
Now, how about ICC-8.0?
icc -O2 paranoia.c
The number of FAILUREs encountered = 2.
The number of SERIOUS DEFECTs discovered = 2.
The number of DEFECTs discovered = 3.
The number of FLAWs discovered = 1.
icc -march=pentium4 paranoia.c
paranoia.c(416) : (col. 2) remark: BLOCK WAS VECTORIZED.
[Note that vectorization was performed even though no optimization
flag was passed]
The number of FLAWs discovered = 1.
[I haven't checked if this result was due to some code being
optimized away at compile time. If anyone wants to check I can
provide the assembly.]
icc -march=pentiumiii paranoia.c
paranoia.c(416) : (col. 2) remark: BLOCK WAS VECTORIZED.
The number of FAILUREs encountered = 2.
The number of SERIOUS DEFECTs discovered = 4.
The number of DEFECTs discovered = 3.
The number of FLAWs discovered = 1.
icc -march=pentiumiii -O2 -mp1 paranoia.c
paranoia.c(416) : (col. 2) remark: BLOCK WAS VECTORIZED.
The number of FAILUREs encountered = 3.
The number of SERIOUS DEFECTs discovered = 3.
The number of DEFECTs discovered = 3.
The number of FLAWs discovered = 1.
The results for the Portland Group compiler version 5.0-2
pgcc -O2 paranoia.c
The number of FAILUREs encountered = 3.
The number of SERIOUS DEFECTs discovered = 2.
The number of DEFECTs discovered = 3.
The number of FLAWs discovered = 2.
pgcc paranoia.c
... the test hangs ...
On sparc-sun-solaris2.7 all the tests pass with both gcc and cc.
Draw your own conclusions from this data.
Please don't CC me on replies for this thread, I'll read them from
the list.