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: optimization/576: gcc performs invalid optimization with floatoperations.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]