* gfortran.h (HAVE_mpc_arc): Define.
* simplify.c (gfc_simplify_acos): Handle complex acos.
(gfc_simplify_acosh): Likewise for acosh.
(gfc_simplify_asin): Likewise for asin.
(gfc_simplify_asinh): Likewise for asinh.
(gfc_simplify_atan): Likewise for atan.
(gfc_simplify_atanh): Likewise for atanh.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@152394
138bc75d-0d04-0410-961f-
82ee72b054a4
+2009-10-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ PR fortran/33197
+ * gfortran.h (HAVE_mpc_arc): Define.
+ * simplify.c (gfc_simplify_acos): Handle complex acos.
+ (gfc_simplify_acosh): Likewise for acosh.
+ (gfc_simplify_asin): Likewise for asin.
+ (gfc_simplify_asinh): Likewise for asinh.
+ (gfc_simplify_atan): Likewise for atan.
+ (gfc_simplify_atanh): Likewise for atanh.
+
2009-10-01 Tobias Burnus <burnus@net-b.de>
PR fortran/41515
2009-10-01 Tobias Burnus <burnus@net-b.de>
PR fortran/41515
# if MPC_VERSION >= MPC_VERSION_NUM(0,6,1)
# define HAVE_mpc_pow
# endif
# if MPC_VERSION >= MPC_VERSION_NUM(0,6,1)
# define HAVE_mpc_pow
# endif
+# if MPC_VERSION >= MPC_VERSION_NUM(0,7,1)
+# define HAVE_mpc_arc
+# endif
#else
#define mpc_realref(X) ((X).r)
#define mpc_imagref(X) ((X).i)
#else
#define mpc_realref(X) ((X).r)
#define mpc_imagref(X) ((X).i)
&x->where);
return &gfc_bad_expr;
}
&x->where);
return &gfc_bad_expr;
}
+ result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where);
+ mpfr_acos (result->value.real, x->value.real, GFC_RND_MODE);
+#ifdef HAVE_mpc_arc
+ result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where);
+ mpc_acos (result->value.complex, x->value.complex, GFC_MPC_RND_MODE);
+ break;
+#else
default:
gfc_internal_error ("in gfc_simplify_acos(): Bad type");
}
default:
gfc_internal_error ("in gfc_simplify_acos(): Bad type");
}
- result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where);
-
- mpfr_acos (result->value.real, x->value.real, GFC_RND_MODE);
return range_check (result, "ACOS");
}
return range_check (result, "ACOS");
}
mpfr_acosh (result->value.real, x->value.real, GFC_RND_MODE);
break;
case BT_COMPLEX:
mpfr_acosh (result->value.real, x->value.real, GFC_RND_MODE);
break;
case BT_COMPLEX:
+#ifdef HAVE_mpc_arc
+ result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where);
+ mpc_acosh (result->value.complex, x->value.complex, GFC_MPC_RND_MODE);
+ break;
+#else
default:
gfc_internal_error ("in gfc_simplify_acosh(): Bad type");
}
default:
gfc_internal_error ("in gfc_simplify_acosh(): Bad type");
}
mpfr_asin (result->value.real, x->value.real, GFC_RND_MODE);
break;
case BT_COMPLEX:
mpfr_asin (result->value.real, x->value.real, GFC_RND_MODE);
break;
case BT_COMPLEX:
+#ifdef HAVE_mpc_arc
+ result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where);
+ mpc_asin (result->value.complex, x->value.complex, GFC_MPC_RND_MODE);
+ break;
+#else
default:
gfc_internal_error ("in gfc_simplify_asin(): Bad type");
}
default:
gfc_internal_error ("in gfc_simplify_asin(): Bad type");
}
mpfr_asinh (result->value.real, x->value.real, GFC_RND_MODE);
break;
case BT_COMPLEX:
mpfr_asinh (result->value.real, x->value.real, GFC_RND_MODE);
break;
case BT_COMPLEX:
+#ifdef HAVE_mpc_arc
+ result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where);
+ mpc_asinh (result->value.complex, x->value.complex, GFC_MPC_RND_MODE);
+ break;
+#else
default:
gfc_internal_error ("in gfc_simplify_asinh(): Bad type");
}
default:
gfc_internal_error ("in gfc_simplify_asinh(): Bad type");
}
mpfr_atan (result->value.real, x->value.real, GFC_RND_MODE);
break;
case BT_COMPLEX:
mpfr_atan (result->value.real, x->value.real, GFC_RND_MODE);
break;
case BT_COMPLEX:
+#ifdef HAVE_mpc_arc
+ result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where);
+ mpc_atan (result->value.complex, x->value.complex, GFC_MPC_RND_MODE);
+ break;
+#else
default:
gfc_internal_error ("in gfc_simplify_atan(): Bad type");
}
default:
gfc_internal_error ("in gfc_simplify_atan(): Bad type");
}
mpfr_atanh (result->value.real, x->value.real, GFC_RND_MODE);
break;
case BT_COMPLEX:
mpfr_atanh (result->value.real, x->value.real, GFC_RND_MODE);
break;
case BT_COMPLEX:
+#ifdef HAVE_mpc_arc
+ result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where);
+ mpc_atanh (result->value.complex, x->value.complex, GFC_MPC_RND_MODE);
+ break;
+#else
default:
gfc_internal_error ("in gfc_simplify_atanh(): Bad type");
}
default:
gfc_internal_error ("in gfc_simplify_atanh(): Bad type");
}