This is the mail archive of the gcc@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: potental fp const fold problem


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   `------------------------


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