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: possible bug with compiled code


On Aug 10, 2001, "H. James de St. Germain" <germain@cs.utah.edu> wrote:

>   the != operator seems to be giving the wrong truth value during execution.
>   In the code below, temp should be equal to the right hand expression.

Nope.  x86 works with excess precision in FP registers, so it's
prefectly possible that temp was spilled into a memory slot and
rounded to 64-bits, whereas the result of the fabs still has the whole
80 bits in an FP register, which explains the difference.  This is
just one of the common pitfalls in floating-point programming.

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