This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: c/7437: Identical unsigned int calculations differ by 1, depending on number of steps in calculation.
- From: Geoff Keating <geoffk at geoffk dot org>
- To: nobody at gcc dot gnu dot org
- Cc: gcc-prs at gcc dot gnu dot org,
- Date: 29 Jul 2002 22:36:01 -0000
- Subject: Re: c/7437: Identical unsigned int calculations differ by 1, depending on number of steps in calculation.
- Reply-to: Geoff Keating <geoffk at geoffk dot org>
The following reply was made to PR c/7437; it has been noted by GNATS.
From: Geoff Keating <geoffk@geoffk.org>
To: sewell@dramail.com
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c/7437: Identical unsigned int calculations differ by 1, depending on number of steps in calculation.
Date: 29 Jul 2002 15:33:55 -0700
This is covered in the manual:
* On 68000 and x86 systems, for instance, you can get paradoxical
results if you test the precise values of floating point numbers.
For example, you can find that a floating point value which is not
a NaN is not equal to itself. This results from the fact that the
floating point registers hold a few more bits of precision than
fit in a `double' in memory. Compiled code moves values between
memory and floating point registers at its convenience, and moving
them into memory truncates them.
You can partially avoid this problem by using the `-ffloat-store'
option (*note Optimize Options::).
--
- Geoffrey Keating <geoffk@geoffk.org> <geoffk@redhat.com>