This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: optimization/576: gcc performs invalid optimization with floatoperations.
- To: goualard at cwi dot nl
- Subject: Re: optimization/576: gcc performs invalid optimization with floatoperations.
- From: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- Date: Thu, 28 Sep 2000 16:33:45 +0100 (BST)
- cc: gcc-gnats at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org
On 28 Sep 2000 goualard@cwi.nl wrote:
> gcc performs optimizations that are invalid for some
> floating-point computations when the rounding direction
> is set towards +infinity or -infinity. As shown in
> the code example, trivial identities do no longer hold.
For this to work properly, according to the C99 standard you must use
"#pragma STDC FENV_ACCESS ON". GCC does not yet support the C99 standard
pragmas, but hopefully it will do so in future. (Note also that using the
<fenv.h> function fesetround() is more portable than using an asm.) This
should for now be considered a missing feature in GCC (documented as
missing at http://gcc.gnu.org/c99status.html). See
http://gcc.gnu.org/contribute.html and
http://gcc.gnu.org/contributewhy.html if you want to contribute an
implementation; I don't know if anyone is working on this.
--
Joseph S. Myers
jsm28@cam.ac.uk