aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/arith.c
diff options
context:
space:
mode:
authorSteven G. Kargl <kargls@comcast.net>2005-03-26 18:33:53 +0000
committerSteven G. Kargl <kargl@gcc.gnu.org>2005-03-26 18:33:53 +0000
commit4c54501bebda7bb7517efcad90e53f9b5ebddbf6 (patch)
tree210151a42decaa567f7ebabb0096919bbeb64b5e /gcc/fortran/arith.c
parentd7b1468bf39286cfb5b7be86e87af3bea4e3b812 (diff)
downloadgcc-4c54501bebda7bb7517efcad90e53f9b5ebddbf6.zip
gcc-4c54501bebda7bb7517efcad90e53f9b5ebddbf6.tar.gz
gcc-4c54501bebda7bb7517efcad90e53f9b5ebddbf6.tar.bz2
Fix illogical logic.
From-SVN: r97082
Diffstat (limited to 'gcc/fortran/arith.c')
-rw-r--r--gcc/fortran/arith.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/gcc/fortran/arith.c b/gcc/fortran/arith.c
index 5871c55..50e2d06 100644
--- a/gcc/fortran/arith.c
+++ b/gcc/fortran/arith.c
@@ -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
- {
- if (rc == ARITH_UNDERFLOW && gfc_option.warn_underflow)
- gfc_warning ("%s at %L", gfc_arith_error (rc), &x->where);
+ arith val = rc;
- if (rc == ARITH_ASYMMETRIC)
- gfc_warning ("%s at %L", gfc_arith_error (rc), &x->where);
+ if (val == ARITH_UNDERFLOW)
+ {
+ if (gfc_option.warn_underflow)
+ gfc_warning ("%s at %L", gfc_arith_error (val), &x->where);
+ val = ARITH_OK;
+ }
- rc = ARITH_OK;
- *rp = r;
+ if (val == ARITH_ASYMMETRIC)
+ {
+ gfc_warning ("%s at %L", gfc_arith_error (val), &x->where);
+ val = ARITH_OK;
}
- return rc;
+ if (val != ARITH_OK)
+ gfc_free_expr (r);
+ else
+ *rp = r;
+
+ return val;
}