This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: [gfortran] Fix NEAREST constant folder


On Sun, Apr 10, 2005 at 04:21:00PM +0200, Tobias Schl?ter wrote:
> 
> There's one shortcoming which I enclosed into an #if 0 which I'd like some
> advice on: NEAREST returns the closest machine-representable number which in
> the case of zero are denormals.  range_check rejects these.  Should I simply
> not range_check (and try to construct the correct value, for which my feeble
> attempt didn't suffice), even though this might lead to underflows in other
> places, or is there an alternative route?

MPFR does not support subnormal numbers, so there isn't much you 
can do.  If you don't range_check, then underflows elsewhere will
be treated as if you set the result to zero.  It's concievable that
someone may use nearest(0,1) to avoid division by zero.  So, I
think our only option is to return +-tiny().  I suggest we have
a comment with this info in the source and perhaps issue a warning
that gfortran does not currently support subnormal numbers.

> Bubblestrapped and regtested on i686-linux.  Ok together with the testcase?

OK to commit to mainline.  OK for 4.0 branch when Mark re-opens the
branch.

-- 
Steve


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