This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Does "gfortran -O0" truncate floating point numbers to their expected precision?
- From: Guan Xin <guanx dot bac at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Wed, 10 Jul 2013 12:01:41 +0200
- Subject: Re: Does "gfortran -O0" truncate floating point numbers to their expected precision?
- References: <CANeMGR7GeWHXdQXP3vQRSNE+wxN+fthCVwGxQ_vK-6B0bbWBTg at mail dot gmail dot com> <CANeMGR49dhFvRmfPAjhEJ_Drs0ip4G8ytzyCHB54z0A5V1pxnQ at mail dot gmail dot com>
On Wed, 03 Jul 2013 08:04:59 -0400, Tim Prince <n8tm@aol.com> wrote:
> This doesn't look to me like F77, although it contains some F66.
Sorry, I write broken Fortran.
>
> If you are using 32-bit gfortran, the i486 code with x87 instructions is particularly prone to this kind of problem. Did you try -march=native, or, if using an extremely old CPU, -ffloat-store?
>
> --
> Tim Prince
I am using gfortran for x86 and x86_64 and got similar problems on both.
Met this problem when I used "-march=native -O4". Problem disappeared
with "-march=native -O4 -ffloat-store".
Thank you for mentioning "-ffloat-store". This is exactly what I was
looking for.
BTW, The performance impact is significant. Now I have modified my
algorithm so that it does not rely on the precision given by
-ffloat-store.
Guan