diff options
author | Steven G. Kargl <kargls@comcast.net> | 2005-03-26 18:33:53 +0000 |
---|---|---|
committer | Steven G. Kargl <kargl@gcc.gnu.org> | 2005-03-26 18:33:53 +0000 |
commit | 4c54501bebda7bb7517efcad90e53f9b5ebddbf6 (patch) | |
tree | 210151a42decaa567f7ebabb0096919bbeb64b5e /gcc | |
parent | d7b1468bf39286cfb5b7be86e87af3bea4e3b812 (diff) | |
download | gcc-4c54501bebda7bb7517efcad90e53f9b5ebddbf6.tar.gz |
Fix illogical logic.
From-SVN: r97082
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fortran/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/fortran/arith.c | 28 |
2 files changed, 21 insertions, 11 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 5e93f5f98cf..04b9e40f8d2 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -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 diff --git a/gcc/fortran/arith.c b/gcc/fortran/arith.c index 5871c55d490..50e2d060918 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; } |