gcc produces a wrong executable code

Alexandre Oliva aoliva@redhat.com
Mon Oct 16 22:29:00 GMT 2000


On Oct 17, 2000, vakopian <vakopian@usc.edu> wrote:

> The rounding error should have been the same in both ways of
> calculations.

That's why I pointed to excess precision.  x86's FPU performs internal
calculations in 80 bits, but when FP registers are spilled, they're
rounded to 64 bits.  In your case, one of the variables is retained in
a register, whereas the other is spilled then reloaded, so it loses
the excess precision and ends up comparing different.

-- 
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