http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48979
--- Comment #9 from Steve Kargl <sgk at troutmask dot apl.washington.edu>
2011-05-12 20:53:37 UTC ---
On Thu, May 12, 2011 at 08:40:48PM +0000, burnus at gcc dot gnu.org wrote:
> (In reply to comment #7)
> > + return range_check (result, "FRACTION");
>
> Can we additionally add to the range_check() error messages a note like "This
> check can be disabled with the option -fno-range-check"? We already did so at
> several places. I think without, one does not know that one can easily disable
> it.
>
> An alternative would be to switch to the middle-end way of showing warning
> messages:
> warning: unused variable 'x' [-Wunused-variable]
>
> Analogously, the error could then be "[-frange-check]".
>
I worked up the following patch. It now silently accepts
fraction() for +-inf and nan for -std=gnu,f2003,f2008. If
one uses -std=f95, you get a bunch of noise. I'll finish
a patch on Saturday.
EXPONENT() is going to be a little more work. When simplication
does not apply, gfortran uses something like
integer(kind=4) D.1559;
integer(kind=4) D.1558;
__builtin_frexpf (nan, &D.1558);
D.1559 = D.1558;
_gfortran_transfer_integer_write (&dt_parm.2, &D.1559, 4);
to grab the fraction and exponent. For nan and +-inf,
D.1558 is 0.