This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Does "gfortran -O0" truncate floating point numbers to their expected precision?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]