Fix illogical logic.

From-SVN: r97082
This commit is contained in:
Steven G. Kargl 2005-03-26 18:33:53 +00:00 committed by Steven G. Kargl
parent d7b1468bf3
commit 4c54501beb
2 changed files with 22 additions and 12 deletions

View File

@ -1,3 +1,7 @@
2005-03-26 Steven G. Kargl <kargls@comcast.net>
* arith.c (check_result): Fix illogical logic.
2005-03-26 Canqun Yang <canqun@nudt.edu.cn>
* trans-common.c (create_common): Build RECORD_NODE for common blocks

View File

@ -552,21 +552,27 @@ gfc_range_check (gfc_expr * e)
static arith
check_result (arith rc, gfc_expr * x, gfc_expr * r, gfc_expr ** rp)
{
if (rc != ARITH_OK)
gfc_free_expr (r);
else
arith val = rc;
if (val == ARITH_UNDERFLOW)
{
if (rc == ARITH_UNDERFLOW && gfc_option.warn_underflow)
gfc_warning ("%s at %L", gfc_arith_error (rc), &x->where);
if (rc == ARITH_ASYMMETRIC)
gfc_warning ("%s at %L", gfc_arith_error (rc), &x->where);
rc = ARITH_OK;
*rp = r;
if (gfc_option.warn_underflow)
gfc_warning ("%s at %L", gfc_arith_error (val), &x->where);
val = ARITH_OK;
}
return rc;
if (val == ARITH_ASYMMETRIC)
{
gfc_warning ("%s at %L", gfc_arith_error (val), &x->where);
val = ARITH_OK;
}
if (val != ARITH_OK)
gfc_free_expr (r);
else
*rp = r;
return val;
}