This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: potental fp const fold problem
- To: Richard Henderson <rth at cygnus dot com>
- Subject: Re: potental fp const fold problem
- From: Ulrich Drepper <drepper at cygnus dot com>
- Date: 27 Jun 1998 12:43:09 -0700
- Cc: egcs at cygnus dot com
- References: <19980627115821.19542@twiddle.rth.home>
- Reply-To: drepper at cygnus dot com (Ulrich Drepper)
Richard Henderson <rth@twiddle.rth.home> writes:
> While browsing fold-const.c though, I found
>
> /* In IEEE floating point, x*1 is not equivalent to x for snans.
> However, ANSI says we can drop signals,
> so we can do this anyway. */
>
> So does this mean that the transformation was legal? If so the
> bug is in glibc (or its test suite), so it would be nice if someone
> could clarify this.
I wrote about this some time ago. Gcc currently misses quite a lot of
functionality since the various PRAGMAs from ISO C 9x are not
implemented.
See ISO C 9x , E.7.4 for examples (in my office there is a copy):
#include <fenv.h>
#pragma STDC FENV_ACCESS ON
void f(void)
{
float w[] = { 0.0/0.0 }; // raise an exception
static float x = 0.0/0.0; // does not raise an exception
float y = 0.0/0.0; // raise an exception
float y = 0.0/0.0; // raise an exception
/* ... */
}
If gcc is implemented as if FENV_ACCESS is off by default we simply
cannot express several things necessary for low-level programming as
in libc. Therefore I'd say this is a bug.
--
---------------. drepper at gnu.org ,-. 1325 Chesapeake Terrace
Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com `------------------------