optimization and printf for i386-pc-solaris-2.7

Alexandre Oliva aoliva@redhat.com
Fri May 11 17:16:00 GMT 2001


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



More information about the Gcc-bugs mailing list