This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: -ffast-math and gfortran
- From: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- To: Toon Moene <toon at moene dot indiv dot nluug dot nl>
- Cc: fortran at gcc dot gnu dot org, fxcoudert at gmail dot com, howarth at bromo dot msbb dot uc dot edu
- Date: Sat, 3 Jun 2006 07:21:56 -0700
- Subject: Re: -ffast-math and gfortran
- References: <E1FlXp4-0001la-UE@laptop.moene.indiv.nluug.nl> <E1FmTSP-00057O-1J@laptop.moene.indiv.nluug.nl>
On Sat, Jun 03, 2006 at 12:34:13PM +0200, Toon Moene wrote:
> > > Yes, this may be target specific.
>
> > That is interesting - it might point to a bug.
>
> > -ffast-math *as far as I know, and I looked into it*, only concerns
> > target-independent transformations.
>
> As I found out during my short trip through gcc/ files searching for
> the use of flag_unsafe_math_optimizations, this is not true anymore.
>
> Usage of built in square root, trigonometric functions, etc. make it
> possible for code compiled with -funsafe-math-optimizations to be
> completely different on different (otherwise IEEE754 conformant)
> targets.
>
For an example of -ffast-math's potential problems, try
compiling netlib's lapack and run the tests. This option
should be renamed to -frisky-math.
With "FFLAGS = -O2 -march=opteron -funroll-loops" I see
a few failures, which are explained by the LAPACK FAQ.
csep.out: CST drivers: 1 out of 11664 tests failed
csep.out: CST: 1 out of 4662 tests failed
csep.out: CST drivers: 2 out of 11664 tests failed
csep.out: CST: 1 out of 4662 tests failed
csep.out: CST drivers: 1 out of 11664 tests failed
dgd.out: DXV drivers: 200 out of 5000 tests failed
sgd.out: SXV drivers: 37 out of 5000 tests failed
ssep.out: SST drivers: 1 out of 14256 tests failed
ssvd.out: SBD: 1 out of 5510 tests failed
ssvd.out: SBD: 1 out of 5510 tests failed
zgd.out: ZXV drivers: 24 out of 5000 tests failed
With "FFLAGS = -O2 -march=opteron -funroll-loops -ffast-math",
the number of failures dramatically increases, and 1 test
goes into an infinite loops.
eig/xeigtstc < cec.in > cec.out <-- Interrupted after 25 minutes of CPU time
cnep.out: CHS: 53 out of 2058 tests failed
cnep.out: CHS: 58 out of 2058 tests failed
cnep.out: CHS: 46 out of 2058 tests failed
cnep.out: CHS: 46 out of 2058 tests failed
cnep.out: CHS: 51 out of 2058 tests failed
csep.out: CST: 1 out of 3276 tests failed
csep.out: CST: 2 out of 3276 tests failed
dgd.out: DGS drivers: 22 out of 1560 tests failed
dgd.out: DXV drivers: 200 out of 5000 tests failed
dgg.out: DGG: 15 out of 2079 tests failed
dgg.out: DGG drivers: 27 out of 1172 tests failed
dgg.out: DGG: 22 out of 2051 tests failed
dgg.out: DGG drivers: 27 out of 1166 tests failed
dgg.out: DGG: 15 out of 2079 tests failed
dgg.out: DGG drivers: 23 out of 1190 tests failed
dgg.out: DGG: 14 out of 2086 tests failed
dgg.out: DGG drivers: 28 out of 1166 tests failed
dsep.out: DST: 2 out of 3276 tests failed
dsvd.out: DBD: 4 out of 5510 tests failed
dsvd.out: DBD: 4 out of 5510 tests failed
dsvd.out: DBD: 2 out of 5510 tests failed
dsvd.out: DBD: 6 out of 5510 tests failed
dsvd.out: DBD: 6 out of 5510 tests failed
dtest.out: DLS drivers: 120 out of 65268 tests failed
sgd.out: SGS drivers: 14 out of 1560 tests failed
sgd.out: SXV drivers: 37 out of 5000 tests failed
sgg.out: SGG: 14 out of 2086 tests failed
sgg.out: SGG drivers: 21 out of 1178 tests failed
sgg.out: SGG: 18 out of 2058 tests failed
sgg.out: SGG drivers: 23 out of 1166 tests failed
sgg.out: SGG: 14 out of 2086 tests failed
sgg.out: SGG drivers: 17 out of 1196 tests failed
sgg.out: SGG: 12 out of 2100 tests failed
sgg.out: SGG drivers: 22 out of 1172 tests failed
ssep.out: SST: 1 out of 3276 tests failed
ssep.out: SST: 2 out of 3276 tests failed
ssvd.out: SBD: 15 out of 5510 tests failed
ssvd.out: SBD: 11 out of 5510 tests failed
ssvd.out: SBD drivers: 8 out of 5320 tests failed
ssvd.out: SBD: 2 out of 5510 tests failed
ssvd.out: SBD drivers: 16 out of 5320 tests failed
ssvd.out: SBD: 6 out of 5510 tests failed
ssvd.out: SBD drivers: 8 out of 5320 tests failed
ssvd.out: SBD: 7 out of 5510 tests failed
stest.out: SLS drivers: 132 out of 65268 tests failed
--
Steve