This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/46080] [4.4/4.5/4.6 Regression] incorrect precision of sqrtf builtin for x87 arithmetic (-mfpmath=387)
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 26 Oct 2010 13:41:12 +0000
- Subject: [Bug target/46080] [4.4/4.5/4.6 Regression] incorrect precision of sqrtf builtin for x87 arithmetic (-mfpmath=387)
- Auto-submitted: auto-generated
- References: <bug-46080-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46080
--- Comment #12 from Jakub Jelinek <jakub at gcc dot gnu.org> 2010-10-26 13:41:10 UTC ---
Well, the setting of errno by calling another function has similar effects like
calling any other function in between, if you do
float a = sqrtf (x);
foo ();
float b = sqrtf (x);
bar ();
float c = sqrtf (x);
printf ("%f %f %f\n", a, b, c);
then there is similar problem - every call in between on i?86/x86_64 will
clobber the i387 register stack in the ABI, so the values need to be flushed
into memory and thus with the fast extended precision mode rounded to floating
point precision, but the c value is probably kept in reg-stack and saved as a
double instead of float, because of varargs in printf. Thus it can have
different value.