This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: optimization/576: gcc performs invalid optimization with floatoperations.
- To: nobody at gcc dot gnu dot org
- Subject: Re: optimization/576: gcc performs invalid optimization with floatoperations.
- From: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- Date: 28 Sep 2000 15:36:01 -0000
- Cc: gcc-prs at gcc dot gnu dot org,
- Reply-To: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
The following reply was made to PR optimization/576; it has been noted by GNATS.
From: "Joseph S. Myers" <jsm28@cam.ac.uk>
To: goualard@cwi.nl
Cc: gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org
Subject: Re: optimization/576: gcc performs invalid optimization with float
operations.
Date: Thu, 28 Sep 2000 16:33:45 +0100 (BST)
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