This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Floating point problems (accuracy).
- From: Ian Lance Taylor <ian at airs dot com>
- To: Vincent Lefevre <vincent+gcc at vinc17 dot org>
- Cc: James E Wilson <wilson at specifixinc dot com>, Phil Prentice <philp dot cheer at btinternet dot com>, mike at stec dot clara dot co dot uk, gcc-help at gcc dot gnu dot org, gcc at gcc dot gnu dot org
- Date: 09 Feb 2005 11:28:03 -0500
- Subject: Re: Floating point problems (accuracy).
- References: <E1Cqyvy-00085r-Ad@monty-python.gnu.org><41ED7E6E.5080905@specifixinc.com><20050209161615.GA3300@dixsept.loria.fr>
Vincent Lefevre <vincent+gcc@vinc17.org> writes:
> But gcc has a real bug concerning the extended precision: it does
> not convert the result into double precision (when using the type
> "double") after a cast or assignment. Such a conversion is required
> by the ISO C standard (see 5.1.2.3#13, 6.3.1.5#2 and 6.3.1.8#2).
> There are no reasons not to fix it. For those who fear a performance
> loss, gcc could define a compiler switch (that could be included in
> -ffast-math).
Try the -ffloat-store option.
It's not the default because it's slows down the generated code too
much, and most people don't care. But you raise an interesting point
about the ISO C standard. It is possible that in strict C99 mode gcc
should enable -ffloat-store on the x86.
Ian