diff options
author | toon <toon@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-06-09 19:57:24 +0000 |
---|---|---|
committer | toon <toon@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-06-09 19:57:24 +0000 |
commit | f5efe504032463d907b2eb0f4f76a5d68ce45429 (patch) | |
tree | b6dedda37c38274545c3226d1e837004d0b4d99e | |
parent | e46563d95c39e4e437ec5f5bd752983f220ef3d1 (diff) | |
download | gcc-f5efe504032463d907b2eb0f4f76a5d68ce45429.tar.gz |
2004-06-09 Toon Moene <toon@moene.indiv.nluug.nl>
* trans-expr.c (gfc_conv_cst_int_power): Compute
x**(-n) by converting it to (1/x)**n instead of
1/x**n.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@82850 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/trans-expr.c | 7 |
2 files changed, 10 insertions, 3 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index d8a6da42f98..a9f08c2df41 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2004-06-09 Toon Moene <toon@moene.indiv.nluug.nl> + + * trans-expr.c (gfc_conv_cst_int_power): Compute + x**(-n) by converting it to (1/x)**n instead of + 1/x**n. + 2004-06-09 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de> PR fortran/13372 diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index dda08bbed81..2258ce6377d 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -526,13 +526,14 @@ gfc_conv_cst_int_power (gfc_se * se, tree lhs, tree rhs) memset (vartmp, 0, sizeof (vartmp)); vartmp[1] = lhs; - - se->expr = gfc_conv_powi (se, n, vartmp); if (sgn == -1) { tmp = gfc_build_const (type, integer_one_node); - se->expr = build (RDIV_EXPR, type, tmp, se->expr); + vartmp[1] = build (RDIV_EXPR, type, tmp, vartmp[1]); } + + se->expr = gfc_conv_powi (se, n, vartmp); + return 1; } |