summaryrefslogtreecommitdiff
path: root/gcc/fortran/arith.c
diff options
context:
space:
mode:
authorburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2007-12-14 15:11:17 +0000
committerburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2007-12-14 15:11:17 +0000
commit073c96a605648f274d4e0e4bf16f4833bcfd524b (patch)
tree5b92aa98aad961b67cdefffbc0c12ff912bfdcd0 /gcc/fortran/arith.c
parent3a23a641423aed45840766437d4553c1a8795eba (diff)
downloadgcc-073c96a605648f274d4e0e4bf16f4833bcfd524b.tar.gz
2007-12-14 Tobias Burnus <burnus@net-b.de>
PR fortran/34398 * expr.c (gfc_check_assign): Add range checks for assignments of * BOZs. * resolve.c (resolve_ordinary_assign): Ditto. * arith.c (gfc_range_check): Fix return value for complex * numbers. 2007-12-14 Tobias Burnus <burnus@net-b.de> PR fortran/34398 * gfortran.dg/nan_4.f90: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130932 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/arith.c')
-rw-r--r--gcc/fortran/arith.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/fortran/arith.c b/gcc/fortran/arith.c
index 01d2989f316..b06aa078c8a 100644
--- a/gcc/fortran/arith.c
+++ b/gcc/fortran/arith.c
@@ -532,6 +532,7 @@ arith
gfc_range_check (gfc_expr *e)
{
arith rc;
+ arith rc2;
switch (e->ts.type)
{
@@ -558,13 +559,16 @@ gfc_range_check (gfc_expr *e)
if (rc == ARITH_NAN)
mpfr_set_nan (e->value.complex.r);
- rc = gfc_check_real_range (e->value.complex.i, e->ts.kind);
+ rc2 = gfc_check_real_range (e->value.complex.i, e->ts.kind);
if (rc == ARITH_UNDERFLOW)
mpfr_set_ui (e->value.complex.i, 0, GFC_RND_MODE);
if (rc == ARITH_OVERFLOW)
mpfr_set_inf (e->value.complex.i, mpfr_sgn (e->value.complex.i));
if (rc == ARITH_NAN)
mpfr_set_nan (e->value.complex.i);
+
+ if (rc == ARITH_OK)
+ rc = rc2;
break;
default: