egcs-1.0.3prerelease - SIGFPE on alphaev5-dev-linux-gnu

Jim Wilson wilson@cygnus.com
Mon May 11 16:15:00 GMT 1998


	    double temp2 = 7.24316e-312;
	    double temp3 = temp * temp2;

	gives a SIGFPE. gdb-4.16 reports:

This looks reasonable to me.  The number used for temp2 does not fit in the
normal range of an IEEE double.  It is representable as a denorm, but Alphas
don't support denorms by default, hence you get a SIGFPE on the multiply.
This example will work if you use -mieee.

We could make gcc friendlier if it detected denorms and warned about them.
For the same testcase, the DEC compiler gives me:

/usr/lib/cmplrs/cc/cfe: Warning: tmp.c, line 4: A denormalized value was encountered by the compiler.  Value truncated to zero
     double temp2 = 7.24316e-312;

which is a little easier to understand than a SIGFPE at runtime.

Jim



More information about the Gcc-bugs mailing list