diff options
author | kargl <kargl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-03-26 18:33:53 +0000 |
---|---|---|
committer | kargl <kargl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-03-26 18:33:53 +0000 |
commit | c98d52b713dc6a5191d0056eb8c249c90ec16c58 (patch) | |
tree | 210151a42decaa567f7ebabb0096919bbeb64b5e /gcc/fortran/arith.c | |
parent | 4ce4dd6bc6e726ac8f573a5349418db793c616f8 (diff) | |
download | gcc-c98d52b713dc6a5191d0056eb8c249c90ec16c58.tar.gz |
Fix illogical logic.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@97082 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/arith.c')
-rw-r--r-- | gcc/fortran/arith.c | 28 |
1 files changed, 17 insertions, 11 deletions
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; } |