From 4c54501bebda7bb7517efcad90e53f9b5ebddbf6 Mon Sep 17 00:00:00 2001 From: "Steven G. Kargl" Date: Sat, 26 Mar 2005 18:33:53 +0000 Subject: Fix illogical logic. From-SVN: r97082 --- gcc/fortran/ChangeLog | 4 ++++ gcc/fortran/arith.c | 28 +++++++++++++++++----------- 2 files changed, 21 insertions(+), 11 deletions(-) (limited to 'gcc') diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 5e93f5f..04b9e40 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,7 @@ +2005-03-26 Steven G. Kargl + + * arith.c (check_result): Fix illogical logic. + 2005-03-26 Canqun Yang * trans-common.c (create_common): Build RECORD_NODE for common blocks 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; } -- cgit v1.1