This is the mail archive of the
mailing list for the GCC project.
Re: Floating poing 'non-bug'? Or is this a bug?
- From: "Yuval Kfir" <yuvalk at mainsoft dot com>
- To: <gcc at gcc dot gnu dot org>
- Cc: "Jim Wilson" <wilson at specifixinc dot com>, "Noam Lampert" <noaml at mainsoft dot com>
- Date: Wed, 7 Jul 2004 09:13:49 +0300
- Subject: Re: Floating poing 'non-bug'? Or is this a bug?
- Organization: Mainsoft Corporation Ltd.
- References: <email@example.com> <40EB5618.firstname.lastname@example.org>
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.