diff options
author | Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> | 2005-03-19 20:23:04 +0100 |
---|---|---|
committer | Tobias Schlüter <tobi@gcc.gnu.org> | 2005-03-19 20:23:04 +0100 |
commit | 0de27aacb6dd0ee17f31b2019a21e75371e15a84 (patch) | |
tree | 2b6f15fb79e704bdf6c80d3a4861d3ee4fc1a23d /gcc/fortran/arith.c | |
parent | 5be245e44f75397ba823f107549f106dcaa9cdf3 (diff) | |
download | gcc-0de27aacb6dd0ee17f31b2019a21e75371e15a84.zip gcc-0de27aacb6dd0ee17f31b2019a21e75371e15a84.tar.gz gcc-0de27aacb6dd0ee17f31b2019a21e75371e15a84.tar.bz2 |
gfortran.h (arith): Remove ARITH_0TO0.
* 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.
From-SVN: r96737
Diffstat (limited to 'gcc/fortran/arith.c')
-rw-r--r-- | gcc/fortran/arith.c | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/gcc/fortran/arith.c b/gcc/fortran/arith.c index 9bcfa0a..5871c55 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: |