This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: possible bug with compiled code
- To: "H. James de St. Germain" <germain at cs dot utah dot edu>
- Subject: Re: possible bug with compiled code
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 10 Aug 2001 17:27:57 -0300
- Cc: gcc-bugs at gcc dot gnu dot org
- Organization: GCC Team, Red Hat
- References: <20010810191842.16CCDFC@juggler.cs.utah.edu>
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