OSDN Git Service

* arith.c (arith_power): Use mpc_pow_z.
authorghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 7 Oct 2009 23:40:25 +0000 (23:40 +0000)
committerghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 7 Oct 2009 23:40:25 +0000 (23:40 +0000)
* gfortran.h (HAVE_mpc_pow_z): Define.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@152544 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/fortran/ChangeLog
gcc/fortran/arith.c
gcc/fortran/gfortran.h

index 5035c1b..9fac2a7 100644 (file)
@@ -1,3 +1,8 @@
+2009-10-07  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+       * arith.c (arith_power): Use mpc_pow_z.
+       * gfortran.h (HAVE_mpc_pow_z): Define.
+
 2009-10-07  Daniel Kraft  <d@domob.eu>
 
        PR fortran/41615
index dddf7e0..82a43ad 100644 (file)
@@ -1111,7 +1111,10 @@ arith_power (gfc_expr *op1, gfc_expr *op2, gfc_expr **resultp)
 
            case BT_COMPLEX:
              {
-#ifdef HAVE_mpc_pow
+#ifdef HAVE_mpc_pow_z
+               mpc_pow_z (result->value.complex, op1->value.complex,
+                          op2->value.integer, GFC_MPC_RND_MODE);
+#elif defined(HAVE_mpc_pow)
                mpc_t apower;
                gfc_set_model (mpc_realref (op1->value.complex));
                mpc_init2 (apower, mpfr_get_default_prec());
index 72f0126..d6ad992 100644 (file)
@@ -1629,6 +1629,7 @@ gfc_class_esym_list;
 # endif
 # if MPC_VERSION >= MPC_VERSION_NUM(0,7,1)
 #  define HAVE_mpc_arc
+#  define HAVE_mpc_pow_z
 # endif
 #else
 #define mpc_realref(X) ((X).r)