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: gcc produces a wrong executable code


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

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