summaryrefslogtreecommitdiff
path: root/gcc/fortran/simplify.c
diff options
context:
space:
mode:
authorfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>2008-03-06 12:40:28 +0000
committerfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>2008-03-06 12:40:28 +0000
commit2dcae6c7bbf834e6af90253040cb30d279773e7b (patch)
treed56bf1a8fd672d2363963eebb687684042a5bcb8 /gcc/fortran/simplify.c
parent70337474d37fdba76f7220fa92d7279e014a314d (diff)
downloadgcc-2dcae6c7bbf834e6af90253040cb30d279773e7b.tar.gz
PR fortran/33197
* intrinsic.c (add_functions): Add simplification routines for ERF, DERF, ERFC and DERFC. * decl.c (gfc_match_suffix, gfc_match_subroutine): Change GNU extensions into Fortran 2008 features. * intrinsic.h (gfc_simplify_erf, gfc_simplify_erfc): New prototypes. * simplify.c (gfc_simplify_erf, gfc_simplify_erfc): New functions. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@132970 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/simplify.c')
-rw-r--r--gcc/fortran/simplify.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c
index a8277ac7046..2272bb567b5 100644
--- a/gcc/fortran/simplify.c
+++ b/gcc/fortran/simplify.c
@@ -1061,6 +1061,38 @@ gfc_simplify_dprod (gfc_expr *x, gfc_expr *y)
gfc_expr *
+gfc_simplify_erf (gfc_expr *x)
+{
+ gfc_expr *result;
+
+ if (x->expr_type != EXPR_CONSTANT)
+ return NULL;
+
+ result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where);
+
+ mpfr_erf (result->value.real, x->value.real, GFC_RND_MODE);
+
+ return range_check (result, "ERF");
+}
+
+
+gfc_expr *
+gfc_simplify_erfc (gfc_expr *x)
+{
+ gfc_expr *result;
+
+ if (x->expr_type != EXPR_CONSTANT)
+ return NULL;
+
+ result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where);
+
+ mpfr_erfc (result->value.real, x->value.real, GFC_RND_MODE);
+
+ return range_check (result, "ERFC");
+}
+
+
+gfc_expr *
gfc_simplify_epsilon (gfc_expr *e)
{
gfc_expr *result;