This is the mail archive of the gcc@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: Floating point problems (accuracy).


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


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