This is the mail archive of the gcc-bugs@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]

Re: optimization and printf for i386-pc-solaris-2.7


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


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