This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: gfortran vs ifort
- From: Tobias Burnus <burnus at net-b dot de>
- To: Girish Kulkarni <girish at athene dot org dot in>, tprince at computer dot org, fortran at gcc dot gnu dot org
- Date: Fri, 29 May 2009 10:06:26 +0200
- Subject: Re: gfortran vs ifort
Girish Kulkarni wrote:
> Surprisingly, results with `ifort -O0` (v 10.1 on amd64) do not match
> with `gfortran -O0` (v 4.1.2 on amd64) for the code that I described
> earlier.
There might be a compiler problem, but more likely is an unstable algorithm.
> Moreover, results with `gfortran -O0` (v 4.1.2 on amd64) *do not
> match* with `gfortran -O0` (v 4.3.2-1.1 on i386).
One likely reason is the excess precision of the x87 math processor;
try -ffloat-store on i386.
Some literature references; GCC specific
http://gcc.gnu.org/wiki/x87note
http://gcc.gnu.org/wiki/FloatingPointMath
http://gcc.gnu.org/wiki/Math_Optimization_Flags
and general and really worth reading:
David Goldberg, What Every Computer Scientist Should Know About Floating-Point Arithmetic
http://www.google.de/search?q=Goldberg+What+Every+Computer+Scientist+Should+Know+About+Floating-Point+Arithmetic
David Monniaux, The pitfalls of verifying floating-point computations:
http://hal.archives-ouvertes.fr/hal-00128124
Tobias