This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: optimization and printf for i386-pc-solaris-2.7
- To: hamaker at isip dot msstate dot edu
- Subject: Re: optimization and printf for i386-pc-solaris-2.7
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 11 May 2001 21:16:06 -0300
- Cc: gcc-bugs at gcc dot gnu dot org
- Organization: GCC Team, Red Hat
- References: <200105111311.IAA07820@isip109.isip.msstate.edu>
On May 11, 2001, Jonathan Hamaker <hamaker@isip.msstate.edu> wrote:
> I suppose we can work around this, but I'm interested to know when and why
> this behavior occurs and how we can design around it in the future.
The intervening print forces z2 to be spilled onto the stack, which
makes it lose the excess precision offered by x86 FP registers.
Basically, you can't expect FP values to be exact. The excess
precision sometimes helps, but sometimes it gets in the way.
-ffloat-store often helps, because then z1 would also be spilled.
Someone recently posted a patch that would cause FP registers to
always be truncated, which would cause predictable, yet less
efficient, behavior.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me