This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: inverted logic in arith.c:gfc_range_check()?
- From: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- To: Paul Brook <paul at codesourcery dot com>
- Cc: fortran at gcc dot gnu dot org, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 16 May 2004 11:24:17 -0700
- Subject: Re: inverted logic in arith.c:gfc_range_check()?
- References: <20040516175224.GA84938@troutmask.apl.washington.edu> <200405161902.49698.paul@codesourcery.com>
On Sun, May 16, 2004 at 07:02:49PM +0100, Paul Brook wrote:
> On Sunday 16 May 2004 18:52, Steve Kargl wrote:
> >
> > seems contrary to the value of (1e50, 1.). Should "!=" actually
> > be "=="? That is, if the real is ok, then check the imaginary part.
>
> Well spotted. Fixed as follows.
>
> Paul
>
I'm looking at PR 14059, which is
In file b.f90:5
x = sqrt(9.125)**2 - 9.125
1
Error: Arithmetic underflow at (1)
Several functions in arith.c, eg., gfc_arith_plus(),
contain the following chunk
rc = gfc_range_check (result);
if (rc != ARITH_OK)
gfc_free_expr (result);
else
*resultp = result;
return rc;
My current thinking is to change this to
if (rc == ARITH_UNDERFLOW)
{
gfc_warning(some phrase)
rc == ARITH_OK;
result->... = 0;
*resultp = result;
}
else if (rc != ARITH_OK)
gfc_free_expr (result);
else
*resultp = result;
return rc;
Does this seem reasonable?
--
Steve