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 poing 'non-bug'? Or is this a bug?


Quoth Jim Wilson:
> This is yet another instance of the "excess precision" problem.  This is
> partly a problem with the x86 FPU design which provides only
> double-extended precision operations. And this is partly a problem with
> the design of the x86 gcc backend, which lies, and claims that we have
> float and double precision operations.
>
> You should get the same result in both cases, but you get a different
> result for one because an intermediate value is written to the stack
> (fstpl) which rounds it to a double, and then loaded back (fldl).  In
> the other case, the intermediate value is not written to the stack, and
> remains a double-extended value with excess precision.

Isn't this something that should be fixed in the gcc backend, then? If the
writing of the intermediate value to the stack was preserved for int
assignments too, or if it was removed for double assignments, then the
result would indeed be the same.

- Yuval


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