From: tobi Date: Sat, 19 Mar 2005 19:23:04 +0000 (+0000) Subject: * gfortran.h (arith): Remove ARITH_0TO0. X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=508b5e7f84d308c99981fccacf06b3cf4249663c;p=thirdparty%2Fgcc.git * gfortran.h (arith): Remove ARITH_0TO0. * arith.c (gfc_arith_error): Remove handling of ARITH_0TO0. (gfc_arith_power): Remove special casing of zero to integral power zero. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96737 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index cddb35888337..0adec316a712 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2005-03-18 Tobias Schl"uter + + * gfortran.h (arith): Remove ARITH_0TO0. + * arith.c (gfc_arith_error): Remove handling of ARITH_0TO0. + (gfc_arith_power): Remove special casing of zero to integral + power zero. + 2005-03-18 Kaveh R. Ghazi * Make-lang.in (fortran-warn): Remove -Wno-error. diff --git a/gcc/fortran/arith.c b/gcc/fortran/arith.c index 9bcfa0a007d0..5871c55d4906 100644 --- a/gcc/fortran/arith.c +++ b/gcc/fortran/arith.c @@ -152,9 +152,6 @@ gfc_arith_error (arith code) case ARITH_DIV0: p = "Division by zero"; break; - case ARITH_0TO0: - p = "Indeterminate form 0 ** 0"; - break; case ARITH_INCOMMENSURATE: p = "Array operands are incommensurate"; break; @@ -918,33 +915,23 @@ gfc_arith_power (gfc_expr * op1, gfc_expr * op2, gfc_expr ** resultp) result = gfc_constant_result (op1->ts.type, op1->ts.kind, &op1->where); if (power == 0) - { /* Handle something to the zeroth power */ + { + /* Handle something to the zeroth power. Since we're dealing + with integral exponents, there is no ambiguity in the + limiting procedure used to determine the value of 0**0. */ switch (op1->ts.type) { case BT_INTEGER: - if (mpz_sgn (op1->value.integer) == 0) - rc = ARITH_0TO0; - else - mpz_set_ui (result->value.integer, 1); + mpz_set_ui (result->value.integer, 1); break; case BT_REAL: - if (mpfr_sgn (op1->value.real) == 0) - rc = ARITH_0TO0; - else - mpfr_set_ui (result->value.real, 1, GFC_RND_MODE); + mpfr_set_ui (result->value.real, 1, GFC_RND_MODE); break; case BT_COMPLEX: - if (mpfr_sgn (op1->value.complex.r) == 0 - && mpfr_sgn (op1->value.complex.i) == 0) - rc = ARITH_0TO0; - else - { - mpfr_set_ui (result->value.complex.r, 1, GFC_RND_MODE); - mpfr_set_ui (result->value.complex.i, 0, GFC_RND_MODE); - } - + mpfr_set_ui (result->value.complex.r, 1, GFC_RND_MODE); + mpfr_set_ui (result->value.complex.i, 0, GFC_RND_MODE); break; default: diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 8be1eb6f2527..82665e9a003c 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -181,7 +181,7 @@ extern mstring intrinsic_operators[]; /* Arithmetic results. */ typedef enum { ARITH_OK = 1, ARITH_OVERFLOW, ARITH_UNDERFLOW, ARITH_NAN, - ARITH_DIV0, ARITH_0TO0, ARITH_INCOMMENSURATE, ARITH_ASYMMETRIC + ARITH_DIV0, ARITH_INCOMMENSURATE, ARITH_ASYMMETRIC } arith;