This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] more g77 runtime library functions for gfortran


On Saturday 28 August 2004 22:46, Steve Kargl wrote:
> The attached files update this patch set to include the additions
> of erf, derf, erfc, derfc, getpid, getgid, and getuid.  Bootstrap
> and regression tested.  No new failures are caused by this patch.
> Here's updated ChangeLogs.

I changed you patch to use the GCC builtins, rather than than calling library 
functions directly, providing libgfortran wrappers for the C99 "float" 
versions where necessary.
I also copied over the old g77 tests for these functions.

Tested on i686-linux.
Applied to mainline as follows.

2004-08-29  Steven G. Kargl  <kargls@comcast.net>
	Paul Brook  <paul@codesourcery.com>

	* check.c (gfc_check_besn, gfc_check_g77_math1): New functions.
	* f95-lang.c (DO_DEFINE_MATH_BUILTIN): Define.
	(DEFINE_MATH_BUILTIN, DEFINE_MATH_BUILTIN_C): Use it.
	(build_builtin_fntypes): New function.
	(gfc_init_builtin_functions): Use it.
	* gfortran.h (enum gfc_generic_isym_id): Add GFC_ISYM_{J,Y}{0,1,N}
	and GFC_ISYM_ERF{,C}.
	(gfc_c_int_kind): Declare.
	* intrinsic.c (add_functions): Add [d]bes* and [d]erf*.
	* intrinsic.h (gfc_check_besn, gfc_check_g77_math1, gfc_resolve_besn,
	gfc_resolve_g77_math1): Add prototypes.
	* resolve.c (gfc_resolve_besn, gfc_resolve_g77_math1): New functions.
	* mathbuiltins.def: Add comment.  Change third argument.  Use
	DEFINE_MATH_BUILTIN_C.  Add bessel and error functions.
	* trans-intrinsic.c (BUILT_IN_FUNCTION): Define.
	(DEFINE_MATH_BUILTIN, DEFINE_MATH_BUILTIN_C): Use it.
	* trans-types.c (gfc_c_int_kind): Declare.
	(gfc_init_kinds): Set it.
testsuite/
	* gfortran.dg/g77/README: Update.
	* gfortran.dg/g77/erfc.f: Copy from g77.f-torture.
	* gfortran.dg/g77/intrinsic-unix-bessel.f: Ditto.
	* gfortran.dg/g77/intrinsic-unix-erf.f: Ditto.
libgfortran/
	* intrinsics/bessel.c: New file.
	* intrinsics/erf.c: New file.
	* Makefie.am: Add intrinsics/bessel.c and intrinsics/erf.c.
	* configure.ac: Test for C99 Bessel and Error functions.
	* Makefile.in: Regenerate.
	* config.h.in: Regenerate.
	* configure: Regenerate.
Index: gcc/fortran/check.c
===================================================================
RCS file: /var/cvsroot/gcc-cvs/gcc/gcc/fortran/check.c,v
retrieving revision 1.12
diff -u -p -r1.12 check.c
--- gcc/fortran/check.c	27 Aug 2004 14:49:34 -0000	1.12
+++ gcc/fortran/check.c	29 Aug 2004 01:31:05 -0000
@@ -525,6 +525,28 @@ gfc_check_atan2 (gfc_expr * y, gfc_expr 
 }
 
   
+/* BESJN and BESYN functions.  */
+
+try
+gfc_check_besn (gfc_expr * n, gfc_expr * x)
+{
+
+  if (scalar_check (n, 0) == FAILURE)
+    return FAILURE;
+
+  if (type_check (n, 0, BT_INTEGER) == FAILURE)
+    return FAILURE;
+
+  if (scalar_check (x, 1) == FAILURE)
+    return FAILURE;
+
+  if (type_check (x, 1, BT_REAL) == FAILURE)
+    return FAILURE;
+
+  return SUCCESS;
+}
+
+
 try
 gfc_check_btest (gfc_expr * i, gfc_expr * pos)
 {
@@ -728,6 +750,22 @@ gfc_check_eoshift (gfc_expr * array, gfc
 }
 
 
+/* This is used for the g77 one-argument Bessel functions, and the
+   error function.  */
+
+try
+gfc_check_g77_math1 (gfc_expr * x)
+{
+
+  if (scalar_check (x, 0) == FAILURE)
+    return FAILURE;
+
+  if (type_check (x, 0, BT_REAL) == FAILURE)
+    return FAILURE;
+
+  return SUCCESS;
+}
+
 
 try
 gfc_check_huge (gfc_expr * x)
Index: gcc/fortran/f95-lang.c
===================================================================
RCS file: /var/cvsroot/gcc-cvs/gcc/gcc/fortran/f95-lang.c,v
retrieving revision 1.15
diff -u -p -r1.15 f95-lang.c
--- gcc/fortran/f95-lang.c	26 Aug 2004 22:19:22 -0000	1.15
+++ gcc/fortran/f95-lang.c	29 Aug 2004 12:23:46 -0000
@@ -712,38 +712,64 @@ gfc_define_builtin (const char * name,
 }
 
 
-#define DEFINE_MATH_BUILTIN(code, name, nargs) \
-    gfc_define_builtin ("__builtin_" name, mfunc_double[nargs-1], \
+#define DO_DEFINE_MATH_BUILTIN(code, name, argtype, tbase) \
+    gfc_define_builtin ("__builtin_" name, tbase##double[argtype], \
 			BUILT_IN_ ## code, name, true); \
-    gfc_define_builtin ("__builtin_" name "f", mfunc_float[nargs-1], \
+    gfc_define_builtin ("__builtin_" name "f", tbase##float[argtype], \
 			BUILT_IN_ ## code ## F, name "f", true);
 
+#define DEFINE_MATH_BUILTIN(code, name, argtype) \
+    DO_DEFINE_MATH_BUILTIN (code, name, argtype, mfunc_)
+
+/* The middle-end is missing builtins for some complex math functions, so
+   we don't use them yet.  */
+#define DEFINE_MATH_BUILTIN_C(code, name, argtype) \
+    DO_DEFINE_MATH_BUILTIN (code, name, argtype, mfunc_)
+/*    DO_DEFINE_MATH_BUILTIN (C##code, "c" name, argtype, mfunc_c)*/
+
+
+/* Create function types for builtin functions.  */
+
+static void
+build_builtin_fntypes (tree * fntype, tree type)
+{
+  tree tmp;
+
+  /* type (*) (type) */
+  tmp = tree_cons (NULL_TREE, float_type_node, void_list_node);
+  fntype[0] = build_function_type (type, tmp);
+  /* type (*) (type, type) */
+  tmp = tree_cons (NULL_TREE, float_type_node, tmp);
+  fntype[1] = build_function_type (type, tmp);
+  /* type (*) (int, type) */
+  tmp = tree_cons (NULL_TREE, integer_type_node, void_list_node);
+  tmp = tree_cons (NULL_TREE, type, tmp);
+  fntype[2] = build_function_type (type, tmp);
+}
+
+
 /* Initialisation of builtin function nodes.  */
+
 static void
 gfc_init_builtin_functions (void)
 {
-  tree mfunc_float[2];
-  tree mfunc_double[2];
+  tree mfunc_float[3];
+  tree mfunc_double[3];
+  tree mfunc_cfloat[3];
+  tree mfunc_cdouble[3];
   tree func_cfloat_float;
   tree func_cdouble_double;
   tree ftype;
   tree tmp;
 
-  tmp = tree_cons (NULL_TREE, float_type_node, void_list_node);
-  mfunc_float[0] = build_function_type (float_type_node, tmp);
-  tmp = tree_cons (NULL_TREE, float_type_node, tmp);
-  mfunc_float[1] = build_function_type (float_type_node, tmp);
-  
+  build_builtin_fntypes (mfunc_float, float_type_node);
+  build_builtin_fntypes (mfunc_double, double_type_node);
+  build_builtin_fntypes (mfunc_cfloat, complex_float_type_node);
+  build_builtin_fntypes (mfunc_cdouble, complex_double_type_node);
+
   tmp = tree_cons (NULL_TREE, complex_float_type_node, void_list_node);
   func_cfloat_float = build_function_type (float_type_node, tmp);
-  
 
-  tmp = tree_cons (NULL_TREE, double_type_node, void_list_node);
-  mfunc_double[0] = build_function_type (double_type_node, tmp);
-  tmp = tree_cons (NULL_TREE, double_type_node, tmp);
-  mfunc_double[1] = build_function_type (double_type_node, tmp);
-  
-  
   tmp = tree_cons (NULL_TREE, complex_double_type_node, void_list_node);
   func_cdouble_double = build_function_type (double_type_node, tmp);
 
@@ -835,6 +861,7 @@ gfc_init_builtin_functions (void)
 		      "alloca", false);
 }
 
+#undef DEFINE_MATH_BUILTIN_C
 #undef DEFINE_MATH_BUILTIN
 
 #include "gt-fortran-f95-lang.h"
Index: gcc/fortran/gfortran.h
===================================================================
RCS file: /var/cvsroot/gcc-cvs/gcc/gcc/fortran/gfortran.h,v
retrieving revision 1.30
diff -u -p -r1.30 gfortran.h
--- gcc/fortran/gfortran.h	28 Aug 2004 23:43:38 -0000	1.30
+++ gcc/fortran/gfortran.h	29 Aug 2004 10:14:41 -0000
@@ -286,6 +286,12 @@ enum gfc_generic_isym_id
   GFC_ISYM_ASSOCIATED,
   GFC_ISYM_ATAN,
   GFC_ISYM_ATAN2,
+  GFC_ISYM_J0,
+  GFC_ISYM_J1,
+  GFC_ISYM_JN,
+  GFC_ISYM_Y0,
+  GFC_ISYM_Y1,
+  GFC_ISYM_YN,
   GFC_ISYM_BTEST,
   GFC_ISYM_CEILING,
   GFC_ISYM_CHAR,
@@ -301,6 +307,8 @@ enum gfc_generic_isym_id
   GFC_ISYM_DOT_PRODUCT,
   GFC_ISYM_DPROD,
   GFC_ISYM_EOSHIFT,
+  GFC_ISYM_ERF,
+  GFC_ISYM_ERFC,
   GFC_ISYM_ETIME,
   GFC_ISYM_EXP,
   GFC_ISYM_EXPONENT,
@@ -1518,6 +1526,7 @@ extern int gfc_default_double_kind;
 extern int gfc_default_character_kind;
 extern int gfc_default_logical_kind;
 extern int gfc_default_complex_kind;
+extern int gfc_c_int_kind;
 
 /* symbol.c */
 void gfc_clear_new_implicit (void);
Index: gcc/fortran/intrinsic.c
===================================================================
RCS file: /var/cvsroot/gcc-cvs/gcc/gcc/fortran/intrinsic.c,v
retrieving revision 1.20
diff -u -p -r1.20 intrinsic.c
--- gcc/fortran/intrinsic.c	28 Aug 2004 23:43:39 -0000	1.20
+++ gcc/fortran/intrinsic.c	29 Aug 2004 14:13:31 -0000
@@ -969,6 +969,68 @@ add_functions (void)
 
   make_generic ("atan2", GFC_ISYM_ATAN2);
 
+  /* Bessel and Neumann functions for G77 compatibility.  */
+
+  add_sym_1 ("besj0", 1, 0, BT_REAL, dr,
+	     gfc_check_g77_math1, NULL, gfc_resolve_g77_math1,
+	     x, BT_REAL, dr, 0);
+
+  add_sym_1 ("dbesj0", 1, 0, BT_REAL, dd,
+	     gfc_check_g77_math1, NULL, gfc_resolve_g77_math1,
+	     x, BT_REAL, dd, 0);
+
+  make_generic ("besj0", GFC_ISYM_J0);
+
+  add_sym_1 ("besj1", 1, 0, BT_REAL, dr,
+	     gfc_check_g77_math1, NULL, gfc_resolve_g77_math1,
+	     x, BT_REAL, dr, 1);
+
+  add_sym_1 ("dbesj1", 1, 0, BT_REAL, dd,
+	     gfc_check_g77_math1, NULL, gfc_resolve_g77_math1,
+	     x, BT_REAL, dd, 1);
+
+  make_generic ("besj1", GFC_ISYM_J1);
+
+  add_sym_2 ("besjn", 1, 0, BT_REAL, dr,
+	     gfc_check_besn, NULL, gfc_resolve_besn, n, BT_INTEGER, di, 1,
+         x, BT_REAL, dr, 1);
+
+  add_sym_2 ("dbesjn", 1, 0, BT_REAL, dd,
+	     gfc_check_besn, NULL, gfc_resolve_besn, n, BT_INTEGER, di, 1,
+         x, BT_REAL, dd, 1);
+
+  make_generic ("besjn", GFC_ISYM_JN);
+
+  add_sym_1 ("besy0", 1, 0, BT_REAL, dr,
+	     gfc_check_g77_math1, NULL, gfc_resolve_g77_math1,
+	     x, BT_REAL, dr, 0);
+
+  add_sym_1 ("dbesy0", 1, 0, BT_REAL, dd,
+	     gfc_check_g77_math1, NULL, gfc_resolve_g77_math1,
+	     x, BT_REAL, dd, 0);
+
+  make_generic ("besy0", GFC_ISYM_Y0);
+
+  add_sym_1 ("besy1", 1, 0, BT_REAL, dr,
+	     gfc_check_g77_math1, NULL, gfc_resolve_g77_math1,
+	     x, BT_REAL, dr, 1);
+
+  add_sym_1 ("dbesy1", 1, 0, BT_REAL, dd,
+	     gfc_check_g77_math1, NULL, gfc_resolve_g77_math1,
+	     x, BT_REAL, dd, 1);
+
+  make_generic ("besy1", GFC_ISYM_Y1);
+
+  add_sym_2 ("besyn", 1, 0, BT_REAL, dr,
+	     gfc_check_besn, NULL, gfc_resolve_besn, n, BT_INTEGER, di, 1,
+         x, BT_REAL, dr, 1);
+
+  add_sym_2 ("dbesyn", 1, 0, BT_REAL, dd,
+	     gfc_check_besn, NULL, gfc_resolve_besn, n, BT_INTEGER, di, 1,
+         x, BT_REAL, dd, 1);
+
+  make_generic ("besyn", GFC_ISYM_YN);
+
   add_sym_1 ("bit_size", 0, 1, BT_INTEGER, di,
 	     gfc_check_i, gfc_simplify_bit_size, NULL,
 	     i, BT_INTEGER, di, 0);
@@ -1113,6 +1175,27 @@ add_functions (void)
 
   make_generic ("epsilon", GFC_ISYM_NONE);
 
+  /* G77 compatibility for the ERF() and ERFC() functions.  */
+  add_sym_1 ("erf", 1, 0, BT_REAL, dr,
+	     gfc_check_g77_math1, NULL, gfc_resolve_g77_math1,
+	     x, BT_REAL, dr, 0);
+
+  add_sym_1 ("derf", 1, 0, BT_REAL, dd,
+	     gfc_check_g77_math1, NULL, gfc_resolve_g77_math1,
+	     x, BT_REAL, dd, 0);
+
+  make_generic ("erf", GFC_ISYM_ERF);
+
+  add_sym_1 ("erfc", 1, 0, BT_REAL, dr,
+	     gfc_check_g77_math1, NULL, gfc_resolve_g77_math1,
+	     x, BT_REAL, dr, 0);
+
+  add_sym_1 ("derfc", 1, 0, BT_REAL, dd,
+	     gfc_check_g77_math1, NULL, gfc_resolve_g77_math1,
+	     x, BT_REAL, dd, 0);
+
+  make_generic ("erfc", GFC_ISYM_ERFC);
+
   /* G77 compatibility */
   add_sym_1 ("etime", 0, 1, BT_REAL, 4,
 	     gfc_check_etime, NULL, NULL,
Index: gcc/fortran/intrinsic.h
===================================================================
RCS file: /var/cvsroot/gcc-cvs/gcc/gcc/fortran/intrinsic.h,v
retrieving revision 1.13
diff -u -p -r1.13 intrinsic.h
--- gcc/fortran/intrinsic.h	28 Aug 2004 23:43:39 -0000	1.13
+++ gcc/fortran/intrinsic.h	29 Aug 2004 10:15:32 -0000
@@ -35,6 +35,7 @@ try gfc_check_all_any (gfc_expr *, gfc_e
 try gfc_check_allocated (gfc_expr *);
 try gfc_check_associated (gfc_expr *, gfc_expr *);
 try gfc_check_atan2 (gfc_expr *, gfc_expr *);
+try gfc_check_besn (gfc_expr *, gfc_expr *);
 try gfc_check_btest (gfc_expr *, gfc_expr *);
 try gfc_check_char (gfc_expr *, gfc_expr *);
 try gfc_check_cmplx (gfc_expr *, gfc_expr *, gfc_expr *);
@@ -47,6 +48,7 @@ try gfc_check_dot_product (gfc_expr *, g
 try gfc_check_eoshift (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
 try gfc_check_etime (gfc_expr *);
 try gfc_check_etime_sub (gfc_expr *, gfc_expr *);
+try gfc_check_g77_math1 (gfc_expr *);
 try gfc_check_huge (gfc_expr *);
 try gfc_check_i (gfc_expr *);
 try gfc_check_iand (gfc_expr *, gfc_expr *);
@@ -231,6 +233,7 @@ void gfc_resolve_any (gfc_expr *, gfc_ex
 void gfc_resolve_asin (gfc_expr *, gfc_expr *);
 void gfc_resolve_atan (gfc_expr *, gfc_expr *);
 void gfc_resolve_atan2 (gfc_expr *, gfc_expr *, gfc_expr *);
+void gfc_resolve_besn (gfc_expr *, gfc_expr *, gfc_expr *);
 void gfc_resolve_btest (gfc_expr *, gfc_expr *, gfc_expr *);
 void gfc_resolve_ceiling (gfc_expr *, gfc_expr *, gfc_expr *);
 void gfc_resolve_char (gfc_expr *, gfc_expr *, gfc_expr *);
@@ -252,6 +255,7 @@ void gfc_resolve_exp (gfc_expr *, gfc_ex
 void gfc_resolve_exponent (gfc_expr *, gfc_expr *);
 void gfc_resolve_floor (gfc_expr *, gfc_expr *, gfc_expr *);
 void gfc_resolve_fraction (gfc_expr *, gfc_expr *);
+void gfc_resolve_g77_math1 (gfc_expr *, gfc_expr *);
 void gfc_resolve_getgid (gfc_expr *);
 void gfc_resolve_getpid (gfc_expr *);
 void gfc_resolve_getuid (gfc_expr *);
Index: gcc/fortran/iresolve.c
===================================================================
RCS file: /var/cvsroot/gcc-cvs/gcc/gcc/fortran/iresolve.c,v
retrieving revision 1.13
diff -u -p -r1.13 iresolve.c
--- gcc/fortran/iresolve.c	28 Aug 2004 23:43:39 -0000	1.13
+++ gcc/fortran/iresolve.c	29 Aug 2004 10:18:50 -0000
@@ -269,6 +269,24 @@ gfc_resolve_atan2 (gfc_expr * f, gfc_exp
 }
 
 
+/* Resolve the BESYN and BESJN intrinsics.  */
+
+void
+gfc_resolve_besn (gfc_expr * f, gfc_expr * n, gfc_expr * x)
+{
+  gfc_typespec ts;
+  
+  f->ts = x->ts;
+  if (n->ts.kind != gfc_c_int_kind)
+    {
+      ts.type = BT_INTEGER;
+      ts.kind = gfc_c_int_kind;
+      gfc_convert_type (n, &ts, 2);
+    }
+  f->value.function.name = gfc_get_string ("<intrinsic>");
+}
+
+
 void
 gfc_resolve_btest (gfc_expr * f, gfc_expr * i, gfc_expr * pos)
 {
@@ -544,6 +562,16 @@ gfc_resolve_fraction (gfc_expr * f, gfc_
 }
 
 
+/* Resolve single-argument g77 math intrinsics, eg BESY0, ERF.  */
+
+void
+gfc_resolve_g77_math1 (gfc_expr * f, gfc_expr * x)
+{
+  f->ts = x->ts;
+  f->value.function.name = gfc_get_string ("<intrinsic>");
+}
+
+
 void
 gfc_resolve_getgid (gfc_expr * f)
 {
Index: gcc/fortran/mathbuiltins.def
===================================================================
RCS file: /var/cvsroot/gcc-cvs/gcc/gcc/fortran/mathbuiltins.def,v
retrieving revision 1.2
diff -u -p -r1.2 mathbuiltins.def
--- gcc/fortran/mathbuiltins.def	13 May 2004 06:40:30 -0000	1.2
+++ gcc/fortran/mathbuiltins.def	29 Aug 2004 14:22:43 -0000
@@ -1,14 +1,29 @@
-DEFINE_MATH_BUILTIN (ACOS,  "acos", 1)
-DEFINE_MATH_BUILTIN (ASIN,  "asin", 1)
-DEFINE_MATH_BUILTIN (ATAN, "atan", 1)
-DEFINE_MATH_BUILTIN (ATAN2, "atan2", 2)
-DEFINE_MATH_BUILTIN (COS, "cos", 1)
-DEFINE_MATH_BUILTIN (COSH,  "cosh", 1)
-DEFINE_MATH_BUILTIN (EXP, "exp", 1)
-DEFINE_MATH_BUILTIN (LOG, "log", 1)
-DEFINE_MATH_BUILTIN (LOG10, "log10", 1)
-DEFINE_MATH_BUILTIN (SIN, "sin", 1)
-DEFINE_MATH_BUILTIN (SINH,  "sinh", 1)
-DEFINE_MATH_BUILTIN (SQRT, "sqrt", 1)
-DEFINE_MATH_BUILTIN (TAN, "tan", 1)
-DEFINE_MATH_BUILTIN (TANH,  "tanh", 1)
+/* DEFINE_MATH_BUILTIN (CODE, NAME, ARGTYPE)
+   NAME	  The name of the builtin
+   SNAME  The name of the builtin as a string
+   ARGTYPE The type of the arguments.  See f95-lang.c
+
+   Use DEFINE_MATH_BUILTIN_C if the complex versions of the builtin are
+   also available.  */
+DEFINE_MATH_BUILTIN_C (ACOS,  "acos",   0)
+DEFINE_MATH_BUILTIN_C (ASIN,  "asin",   0)
+DEFINE_MATH_BUILTIN_C (ATAN,  "atan",   0)
+DEFINE_MATH_BUILTIN   (ATAN2, "atan2",  1)
+DEFINE_MATH_BUILTIN_C (COS,   "cos",    0)
+DEFINE_MATH_BUILTIN_C (COSH,  "cosh",   0)
+DEFINE_MATH_BUILTIN_C (EXP,   "exp",    0)
+DEFINE_MATH_BUILTIN_C (LOG,   "log",    0)
+DEFINE_MATH_BUILTIN_C (LOG10, "log10",  0)
+DEFINE_MATH_BUILTIN_C (SIN,   "sin",    0)
+DEFINE_MATH_BUILTIN_C (SINH,  "sinh",   0)
+DEFINE_MATH_BUILTIN_C (SQRT,  "sqrt",   0)
+DEFINE_MATH_BUILTIN_C (TAN,   "tan",    0)
+DEFINE_MATH_BUILTIN_C (TANH,  "tanh",   0)
+DEFINE_MATH_BUILTIN   (J0,    "j0",     0)
+DEFINE_MATH_BUILTIN   (J1,    "j1",     0)
+DEFINE_MATH_BUILTIN   (JN,    "jn",     2)
+DEFINE_MATH_BUILTIN   (Y0,    "y0",     0)
+DEFINE_MATH_BUILTIN   (Y1,    "y1",     0)
+DEFINE_MATH_BUILTIN   (YN,    "yn",     2)
+DEFINE_MATH_BUILTIN   (ERF,   "erf",    0)
+DEFINE_MATH_BUILTIN   (ERFC,  "erfc",   0)
Index: gcc/fortran/trans-intrinsic.c
===================================================================
RCS file: /var/cvsroot/gcc-cvs/gcc/gcc/fortran/trans-intrinsic.c,v
retrieving revision 1.18
diff -u -p -r1.18 trans-intrinsic.c
--- gcc/fortran/trans-intrinsic.c	28 Aug 2004 23:43:39 -0000	1.18
+++ gcc/fortran/trans-intrinsic.c	29 Aug 2004 13:23:57 -0000
@@ -85,9 +85,16 @@ gfc_intrinsic_map_t;
 /* ??? The NARGS==1 hack here is based on the fact that (c99 at least)
    defines complex variants of all of the entries in mathbuiltins.def
    except for atan2.  */
-#define DEFINE_MATH_BUILTIN(ID, NAME, NARGS) \
+#define BUILT_IN_FUNCTION(ID, NAME, HAVE_COMPLEX) \
   { GFC_ISYM_ ## ID, BUILT_IN_ ## ID ## F, BUILT_IN_ ## ID, true, \
-    NARGS == 1, true, NAME, NULL_TREE, NULL_TREE, NULL_TREE, NULL_TREE},
+    HAVE_COMPLEX, true, NAME, NULL_TREE, NULL_TREE, NULL_TREE, NULL_TREE},
+
+#define DEFINE_MATH_BUILTIN(id, name, argtype) \
+  BUILT_IN_FUNCTION (id, name, false)
+
+/* TODO: Use builtin function for complex intrinsics.  */
+#define DEFINE_MATH_BUILTIN_C(id, name, argtype) \
+  BUILT_IN_FUNCTION (id, name, true)
 
 #define LIBM_FUNCTION(ID, NAME, HAVE_COMPLEX) \
   { GFC_ISYM_ ## ID, END_BUILTINS, END_BUILTINS, true, HAVE_COMPLEX, true, \
@@ -117,6 +124,8 @@ static GTY(()) gfc_intrinsic_map_t gfc_i
   LIBF_FUNCTION (NONE, NULL, false)
 };
 #undef DEFINE_MATH_BUILTIN
+#undef DEFINE_MATH_BUILTIN_C
+#undef BUILT_IN_FUNCTION
 #undef LIBM_FUNCTION
 #undef LIBF_FUNCTION
 
Index: gcc/fortran/trans-types.c
===================================================================
RCS file: /var/cvsroot/gcc-cvs/gcc/gcc/fortran/trans-types.c,v
retrieving revision 1.19
diff -u -p -r1.19 trans-types.c
--- gcc/fortran/trans-types.c	27 Aug 2004 14:49:35 -0000	1.19
+++ gcc/fortran/trans-types.c	29 Aug 2004 11:37:25 -0000
@@ -84,6 +84,7 @@ int gfc_default_double_kind;
 int gfc_default_character_kind;
 int gfc_default_logical_kind;
 int gfc_default_complex_kind;
+int gfc_c_int_kind;
 
 /* Query the target to determine which machine modes are available for
    computation.  Choose KIND numbers for them.  */
@@ -232,6 +233,8 @@ gfc_init_kinds (void)
 
   /* Choose the integer kind the same size as "void*" for our index kind.  */
   gfc_index_integer_kind = POINTER_SIZE / 8;
+  /* Pick a kind the same size as the C "int" type.  */
+  gfc_c_int_kind = INT_TYPE_SIZE / 8;
 }
 
 /* Make sure that a valid kind is present.  Returns an index into the
Index: gcc/testsuite/gfortran.dg/g77/README
===================================================================
RCS file: /var/cvsroot/gcc-cvs/gcc/gcc/testsuite/gfortran.dg/g77/README,v
retrieving revision 1.4
diff -u -p -r1.4 README
--- gcc/testsuite/gfortran.dg/g77/README	22 Jul 2004 13:10:13 -0000	1.4
+++ gcc/testsuite/gfortran.dg/g77/README	29 Aug 2004 13:06:37 -0000
@@ -167,15 +167,15 @@ cpp.F	(Renamed cpp3.F)	Y
 cpp2.F				- Compiler warnings
 dcomplex.f			Y
 dnrm2.f				Y Add dg-warning as required
-erfc.f				  Link errors
+erfc.f				Y
 exp.f				  Compiler warnings and fails
 f90-intrinsic-bit.f             F 16581 Compile errors
 f90-intrinsic-mathematical.f	Y 
 f90-intrinsic-numeric.f		Y
 int8421.f			Y
 intrinsic-f2c-z.f		F Execution fail
-intrinsic-unix-bessel.f		  Link errors
-intrinsic-unix-erf.f		  Link erros
+intrinsic-unix-bessel.f		Y
+intrinsic-unix-erf.f		Y
 intrinsic-vax-cd.f		F Execution fail
 intrinsic77.f	 		F PR 16580 Compiler ICE
 io0.f & io0.x
Index: gcc/testsuite/gfortran.dg/g77/erfc.f
===================================================================
RCS file: gcc/testsuite/gfortran.dg/g77/erfc.f
diff -N gcc/testsuite/gfortran.dg/g77/erfc.f
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gcc/testsuite/gfortran.dg/g77/erfc.f	29 Aug 2004 13:08:44 -0000
@@ -0,0 +1,39 @@
+c { dg-do run }
+c============================================== test.f
+                real x, y
+		real*8 x1, y1
+		x=0.
+		y = erfc(x)
+		if (y .ne. 1.) call abort
+
+		x=1.1
+		y = erfc(x)
+		if (abs(y - .1197949) .ge. 1.e-6) call abort
+
+* modified from x=10, y .gt. 1.5e-44 to avoid lack of -mieee on Alphas.
+		x=8
+		y = erfc(x)
+		if (y .gt. 1.2e-28) call abort
+
+		x1=0.
+		y1 = erfc(x1)
+		if (y1 .ne. 1.) call abort
+
+		x1=1.1d0
+		y1 = erfc(x1)
+		if (abs(y1 - .1197949d0) .ge. 1.d-6) call abort
+
+		x1=10
+		y1 = erfc(x1)
+		if (y1 .gt. 1.5d-44) call abort
+		end
+c=================================================
+!output:
+!  0.  1.875
+!  1.10000002  1.48958981
+!  10.  5.00220949E-06
+!
+!The values should be:
+!erfc(0)=1
+!erfc(1.1)= 0.1197949
+!erfc(10)<1.543115467311259E-044
Index: gcc/testsuite/gfortran.dg/g77/intrinsic-unix-bessel.f
===================================================================
RCS file: gcc/testsuite/gfortran.dg/g77/intrinsic-unix-bessel.f
diff -N gcc/testsuite/gfortran.dg/g77/intrinsic-unix-bessel.f
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gcc/testsuite/gfortran.dg/g77/intrinsic-unix-bessel.f	29 Aug 2004 13:08:50 -0000
@@ -0,0 +1,109 @@
+c { dg-do run }
+c  intrinsic-unix-bessel.f
+c
+c Test Bessel function intrinsics.  
+c These functions are only available if provided by system
+c
+c     David Billinghurst <David.Billinghurst@riotinto.com>
+c
+      real x, a
+      double precision dx, da
+      integer i
+      integer*2 j
+      integer*1 k
+      integer*8 m
+      logical fail
+      common /flags/ fail
+      fail = .false.
+
+      x = 2.0
+      dx = x 
+      i = 2
+      j = i
+      k = i
+      m = i
+c     BESJ0  - Bessel function of first kind of order zero
+      a = 0.22389077
+      da = a
+      call c_r(BESJ0(x),a,'BESJ0(real)')
+      call c_d(BESJ0(dx),da,'BESJ0(double)')
+      call c_d(DBESJ0(dx),da,'DBESJ0(double)')
+
+c     BESJ1  - Bessel function of first kind of order one
+      a = 0.57672480
+      da = a
+      call c_r(BESJ1(x),a,'BESJ1(real)')
+      call c_d(BESJ1(dx),da,'BESJ1(double)')
+      call c_d(DBESJ1(dx),da,'DBESJ1(double)')
+
+c     BESJN  - Bessel function of first kind of order N
+      a = 0.3528340
+      da = a
+      call c_r(BESJN(i,x),a,'BESJN(integer,real)')
+      call c_r(BESJN(j,x),a,'BESJN(integer*2,real)')
+      call c_r(BESJN(k,x),a,'BESJN(integer*1,real)')
+      call c_d(BESJN(i,dx),da,'BESJN(integer,double)')
+      call c_d(BESJN(j,dx),da,'BESJN(integer*2,double)')
+      call c_d(BESJN(k,dx),da,'BESJN(integer*1,double)')
+      call c_d(DBESJN(i,dx),da,'DBESJN(integer,double)')
+      call c_d(DBESJN(j,dx),da,'DBESJN(integer*2,double)')
+      call c_d(DBESJN(k,dx),da,'DBESJN(integer*1,double)')
+
+c     BESY0  - Bessel function of second kind of order zero
+      a = 0.51037567
+      da = a
+      call c_r(BESY0(x),a,'BESY0(real)')
+      call c_d(BESY0(dx),da,'BESY0(double)')
+      call c_d(DBESY0(dx),da,'DBESY0(double)')
+
+c     BESY1  - Bessel function of second kind of order one
+      a = 0.-0.1070324
+      da = a
+      call c_r(BESY1(x),a,'BESY1(real)')
+      call c_d(BESY1(dx),da,'BESY1(double)')
+      call c_d(DBESY1(dx),da,'DBESY1(double)')
+
+c     BESYN  - Bessel function of second kind of order N
+      a = -0.6174081
+      da = a
+      call c_r(BESYN(i,x),a,'BESYN(integer,real)')
+      call c_r(BESYN(j,x),a,'BESYN(integer*2,real)')
+      call c_r(BESYN(k,x),a,'BESYN(integer*1,real)')
+      call c_d(BESYN(i,dx),da,'BESYN(integer,double)')
+      call c_d(BESYN(j,dx),da,'BESYN(integer*2,double)')
+      call c_d(BESYN(k,dx),da,'BESYN(integer*1,double)')
+      call c_d(DBESYN(i,dx),da,'DBESYN(integer,double)')
+      call c_d(DBESYN(j,dx),da,'DBESYN(integer*2,double)')
+      call c_d(DBESYN(k,dx),da,'DBESYN(integer*1,double)')
+
+      if ( fail ) call abort()
+      end
+
+      subroutine failure(label)
+c     Report failure and set flag
+      character*(*) label
+      logical fail
+      common /flags/ fail
+      write(6,'(a,a,a)') 'Test ',label,' FAILED'
+      fail = .true.
+      end
+
+      subroutine c_r(a,b,label)
+c     Check if REAL a equals b, and fail otherwise
+      real a, b
+      character*(*) label
+      if ( abs(a-b) .gt. 1.0e-5 ) then
+         call failure(label)
+         write(6,*) 'Got ',a,' expected ', b
+      end if
+      end
+
+      subroutine c_d(a,b,label)
+c     Check if DOUBLE PRECISION a equals b, and fail otherwise
+      double precision a, b
+      character*(*) label
+      if ( abs(a-b) .gt. 1.0d-5 ) then
+         call failure(label)
+         write(6,*) 'Got ',a,' expected ', b
+      end if
+      end
Index: gcc/testsuite/gfortran.dg/g77/intrinsic-unix-erf.f
===================================================================
RCS file: gcc/testsuite/gfortran.dg/g77/intrinsic-unix-erf.f
diff -N gcc/testsuite/gfortran.dg/g77/intrinsic-unix-erf.f
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gcc/testsuite/gfortran.dg/g77/intrinsic-unix-erf.f	29 Aug 2004 13:08:50 -0000
@@ -0,0 +1,61 @@
+c { dg-do run }
+c  intrinsic-unix-erf.f
+c
+c Test Bessel function intrinsics.  
+c These functions are only available if provided by system
+c
+c     David Billinghurst <David.Billinghurst@riotinto.com>
+c
+      real x, a
+      double precision dx, da
+      logical fail
+      common /flags/ fail
+      fail = .false.
+
+      x = 0.6
+      dx = x 
+c     ERF  - error function
+      a = 0.6038561
+      da = a
+      call c_r(ERF(x),a,'ERF(real)')
+      call c_d(ERF(dx),da,'ERF(double)')
+      call c_d(DERF(dx),da,'DERF(double)')
+
+c     ERFC  - complementary error function
+      a = 1.0 - a
+      da = a
+      call c_r(ERFC(x),a,'ERFC(real)')
+      call c_d(ERFC(dx),da,'ERFC(double)')
+      call c_d(DERFC(dx),da,'DERFC(double)')
+
+      if ( fail ) call abort()
+      end
+
+      subroutine failure(label)
+c     Report failure and set flag
+      character*(*) label
+      logical fail
+      common /flags/ fail
+      write(6,'(a,a,a)') 'Test ',label,' FAILED'
+      fail = .true.
+      end
+
+      subroutine c_r(a,b,label)
+c     Check if REAL a equals b, and fail otherwise
+      real a, b
+      character*(*) label
+      if ( abs(a-b) .gt. 1.0e-5 ) then
+         call failure(label)
+         write(6,*) 'Got ',a,' expected ', b
+      end if
+      end
+
+      subroutine c_d(a,b,label)
+c     Check if DOUBLE PRECISION a equals b, and fail otherwise
+      double precision a, b
+      character*(*) label
+      if ( abs(a-b) .gt. 1.0d-5 ) then
+         call failure(label)
+         write(6,*) 'Got ',a,' expected ', b
+      end if
+      end
Index: libgfortran/Makefile.am
===================================================================
RCS file: /var/cvsroot/gcc-cvs/gcc/libgfortran/Makefile.am,v
retrieving revision 1.15
diff -u -p -r1.15 Makefile.am
--- libgfortran/Makefile.am	28 Aug 2004 23:43:40 -0000	1.15
+++ libgfortran/Makefile.am	29 Aug 2004 14:50:19 -0000
@@ -39,11 +39,13 @@ gfor_helper_src= \
 intrinsics/associated.c \
 intrinsics/abort.c \
 intrinsics/args.c \
+intrinsics/bessel.c \
 intrinsics/c99_functions.c \
 intrinsics/cpu_time.c \
 intrinsics/cshift0.c \
 intrinsics/date_and_time.c \
 intrinsics/env.c \
+intrinsics/erf.c \
 intrinsics/eoshift0.c \
 intrinsics/eoshift2.c \
 intrinsics/etime.c \
Index: libgfortran/Makefile.in
===================================================================
RCS file: /var/cvsroot/gcc-cvs/gcc/libgfortran/Makefile.in,v
retrieving revision 1.15
diff -u -p -r1.15 Makefile.in
--- libgfortran/Makefile.in	28 Aug 2004 23:43:40 -0000	1.15
+++ libgfortran/Makefile.in	29 Aug 2004 15:22:46 -0000
@@ -118,14 +118,14 @@ am__objects_31 = $(am__objects_2) $(am__
 am__objects_32 = backspace.lo close.lo endfile.lo format.lo inquire.lo \
 	list_read.lo lock.lo open.lo read.lo rewind.lo transfer.lo \
 	unit.lo unix.lo write.lo
-am__objects_33 = associated.lo abort.lo args.lo c99_functions.lo \
-	cpu_time.lo cshift0.lo date_and_time.lo env.lo eoshift0.lo \
-	eoshift2.lo etime.lo getXid.lo ishftc.lo pack_generic.lo \
-	size.lo spread_generic.lo string_intrinsics.lo rand.lo \
-	random.lo reshape_generic.lo reshape_packed.lo \
-	selected_kind.lo system_clock.lo transpose_generic.lo \
-	unpack_generic.lo in_pack_generic.lo in_unpack_generic.lo \
-	normalize.lo
+am__objects_33 = associated.lo abort.lo args.lo bessel.lo \
+	c99_functions.lo cpu_time.lo cshift0.lo date_and_time.lo \
+	env.lo erf.lo eoshift0.lo eoshift2.lo etime.lo getXid.lo \
+	ishftc.lo pack_generic.lo size.lo spread_generic.lo \
+	string_intrinsics.lo rand.lo random.lo reshape_generic.lo \
+	reshape_packed.lo selected_kind.lo system_clock.lo \
+	transpose_generic.lo unpack_generic.lo in_pack_generic.lo \
+	in_unpack_generic.lo normalize.lo
 am__objects_34 =
 am__objects_35 = _abs_c4.lo _abs_c8.lo _abs_i4.lo _abs_i8.lo \
 	_abs_r4.lo _abs_r8.lo _exp_r4.lo _exp_r8.lo _exp_c4.lo \
@@ -311,11 +311,13 @@ gfor_helper_src = \
 intrinsics/associated.c \
 intrinsics/abort.c \
 intrinsics/args.c \
+intrinsics/bessel.c \
 intrinsics/c99_functions.c \
 intrinsics/cpu_time.c \
 intrinsics/cshift0.c \
 intrinsics/date_and_time.c \
 intrinsics/env.c \
+intrinsics/erf.c \
 intrinsics/eoshift0.c \
 intrinsics/eoshift2.c \
 intrinsics/etime.c \
@@ -1992,6 +1994,15 @@ args.obj: intrinsics/args.c
 args.lo: intrinsics/args.c
 	$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o args.lo `test -f 'intrinsics/args.c' || echo '$(srcdir)/'`intrinsics/args.c
 
+bessel.o: intrinsics/bessel.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bessel.o `test -f 'intrinsics/bessel.c' || echo '$(srcdir)/'`intrinsics/bessel.c
+
+bessel.obj: intrinsics/bessel.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bessel.obj `if test -f 'intrinsics/bessel.c'; then $(CYGPATH_W) 'intrinsics/bessel.c'; else $(CYGPATH_W) '$(srcdir)/intrinsics/bessel.c'; fi`
+
+bessel.lo: intrinsics/bessel.c
+	$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bessel.lo `test -f 'intrinsics/bessel.c' || echo '$(srcdir)/'`intrinsics/bessel.c
+
 c99_functions.o: intrinsics/c99_functions.c
 	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o c99_functions.o `test -f 'intrinsics/c99_functions.c' || echo '$(srcdir)/'`intrinsics/c99_functions.c
 
@@ -2037,6 +2048,15 @@ env.obj: intrinsics/env.c
 env.lo: intrinsics/env.c
 	$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o env.lo `test -f 'intrinsics/env.c' || echo '$(srcdir)/'`intrinsics/env.c
 
+erf.o: intrinsics/erf.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o erf.o `test -f 'intrinsics/erf.c' || echo '$(srcdir)/'`intrinsics/erf.c
+
+erf.obj: intrinsics/erf.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o erf.obj `if test -f 'intrinsics/erf.c'; then $(CYGPATH_W) 'intrinsics/erf.c'; else $(CYGPATH_W) '$(srcdir)/intrinsics/erf.c'; fi`
+
+erf.lo: intrinsics/erf.c
+	$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o erf.lo `test -f 'intrinsics/erf.c' || echo '$(srcdir)/'`intrinsics/erf.c
+
 eoshift0.o: intrinsics/eoshift0.c
 	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o eoshift0.o `test -f 'intrinsics/eoshift0.c' || echo '$(srcdir)/'`intrinsics/eoshift0.c
 
Index: libgfortran/config.h.in
===================================================================
RCS file: /var/cvsroot/gcc-cvs/gcc/libgfortran/config.h.in,v
retrieving revision 1.6
diff -u -p -r1.6 config.h.in
--- libgfortran/config.h.in	28 Aug 2004 23:43:40 -0000	1.6
+++ libgfortran/config.h.in	29 Aug 2004 15:23:00 -0000
@@ -30,6 +30,18 @@
 /* libm includes coshf */
 #undef HAVE_COSHF
 
+/* libm includes erf */
+#undef HAVE_ERF
+
+/* libm includes erfc */
+#undef HAVE_ERFC
+
+/* libm includes erfcf */
+#undef HAVE_ERFCF
+
+/* libm includes erff */
+#undef HAVE_ERFF
+
 /* libm includes expf */
 #undef HAVE_EXPF
 
@@ -63,6 +75,24 @@
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
+/* libm includes j0 */
+#undef HAVE_J0
+
+/* libm includes j0f */
+#undef HAVE_J0F
+
+/* libm includes j1 */
+#undef HAVE_J1
+
+/* libm includes j1f */
+#undef HAVE_J1F
+
+/* libm includes jn */
+#undef HAVE_JN
+
+/* libm includes jnf */
+#undef HAVE_JNF
+
 /* libm includes log10f */
 #undef HAVE_LOG10F
 
@@ -156,6 +186,24 @@
 /* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
 
+/* libm includes y0 */
+#undef HAVE_Y0
+
+/* libm includes y0f */
+#undef HAVE_Y0F
+
+/* libm includes y1 */
+#undef HAVE_Y1
+
+/* libm includes y1f */
+#undef HAVE_Y1F
+
+/* libm includes yn */
+#undef HAVE_YN
+
+/* libm includes ynf */
+#undef HAVE_YNF
+
 /* Define to the address where bug reports for this package should be sent. */
 #undef PACKAGE_BUGREPORT
 
Index: libgfortran/configure
===================================================================
RCS file: /var/cvsroot/gcc-cvs/gcc/libgfortran/configure,v
retrieving revision 1.12
diff -u -p -r1.12 configure
--- libgfortran/configure	28 Aug 2004 23:43:40 -0000	1.12
+++ libgfortran/configure	29 Aug 2004 15:22:54 -0000
@@ -6895,6 +6895,7 @@ fi
 
 
 # Check for C99 (and other IEEE) math functions
+# ??? This list seems awful long. Is there a better way to test for these?
 echo "$as_me:$LINENO: checking for acosf in -lm" >&5
 echo $ECHO_N "checking for acosf in -lm... $ECHO_C" >&6
 if test "${ac_cv_lib_m_acosf+set}" = set; then
@@ -8599,6 +8600,1142 @@ _ACEOF
 
 fi
 
+echo "$as_me:$LINENO: checking for erf in -lm" >&5
+echo $ECHO_N "checking for erf in -lm... $ECHO_C" >&6
+if test "${ac_cv_lib_m_erf+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char erf ();
+int
+main ()
+{
+erf ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_m_erf=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_m_erf=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_m_erf" >&5
+echo "${ECHO_T}$ac_cv_lib_m_erf" >&6
+if test $ac_cv_lib_m_erf = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ERF 1
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking for erfc in -lm" >&5
+echo $ECHO_N "checking for erfc in -lm... $ECHO_C" >&6
+if test "${ac_cv_lib_m_erfc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char erfc ();
+int
+main ()
+{
+erfc ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_m_erfc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_m_erfc=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_m_erfc" >&5
+echo "${ECHO_T}$ac_cv_lib_m_erfc" >&6
+if test $ac_cv_lib_m_erfc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ERFC 1
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking for erfcf in -lm" >&5
+echo $ECHO_N "checking for erfcf in -lm... $ECHO_C" >&6
+if test "${ac_cv_lib_m_erfcf+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char erfcf ();
+int
+main ()
+{
+erfcf ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_m_erfcf=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_m_erfcf=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_m_erfcf" >&5
+echo "${ECHO_T}$ac_cv_lib_m_erfcf" >&6
+if test $ac_cv_lib_m_erfcf = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ERFCF 1
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking for erff in -lm" >&5
+echo $ECHO_N "checking for erff in -lm... $ECHO_C" >&6
+if test "${ac_cv_lib_m_erff+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char erff ();
+int
+main ()
+{
+erff ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_m_erff=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_m_erff=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_m_erff" >&5
+echo "${ECHO_T}$ac_cv_lib_m_erff" >&6
+if test $ac_cv_lib_m_erff = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ERFF 1
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking for j0 in -lm" >&5
+echo $ECHO_N "checking for j0 in -lm... $ECHO_C" >&6
+if test "${ac_cv_lib_m_j0+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char j0 ();
+int
+main ()
+{
+j0 ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_m_j0=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_m_j0=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_m_j0" >&5
+echo "${ECHO_T}$ac_cv_lib_m_j0" >&6
+if test $ac_cv_lib_m_j0 = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_J0 1
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking for j0f in -lm" >&5
+echo $ECHO_N "checking for j0f in -lm... $ECHO_C" >&6
+if test "${ac_cv_lib_m_j0f+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char j0f ();
+int
+main ()
+{
+j0f ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_m_j0f=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_m_j0f=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_m_j0f" >&5
+echo "${ECHO_T}$ac_cv_lib_m_j0f" >&6
+if test $ac_cv_lib_m_j0f = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_J0F 1
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking for j1 in -lm" >&5
+echo $ECHO_N "checking for j1 in -lm... $ECHO_C" >&6
+if test "${ac_cv_lib_m_j1+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char j1 ();
+int
+main ()
+{
+j1 ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_m_j1=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_m_j1=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_m_j1" >&5
+echo "${ECHO_T}$ac_cv_lib_m_j1" >&6
+if test $ac_cv_lib_m_j1 = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_J1 1
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking for j1f in -lm" >&5
+echo $ECHO_N "checking for j1f in -lm... $ECHO_C" >&6
+if test "${ac_cv_lib_m_j1f+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char j1f ();
+int
+main ()
+{
+j1f ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_m_j1f=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_m_j1f=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_m_j1f" >&5
+echo "${ECHO_T}$ac_cv_lib_m_j1f" >&6
+if test $ac_cv_lib_m_j1f = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_J1F 1
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking for jn in -lm" >&5
+echo $ECHO_N "checking for jn in -lm... $ECHO_C" >&6
+if test "${ac_cv_lib_m_jn+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char jn ();
+int
+main ()
+{
+jn ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_m_jn=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_m_jn=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_m_jn" >&5
+echo "${ECHO_T}$ac_cv_lib_m_jn" >&6
+if test $ac_cv_lib_m_jn = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_JN 1
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking for jnf in -lm" >&5
+echo $ECHO_N "checking for jnf in -lm... $ECHO_C" >&6
+if test "${ac_cv_lib_m_jnf+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char jnf ();
+int
+main ()
+{
+jnf ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_m_jnf=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_m_jnf=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_m_jnf" >&5
+echo "${ECHO_T}$ac_cv_lib_m_jnf" >&6
+if test $ac_cv_lib_m_jnf = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_JNF 1
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking for y0 in -lm" >&5
+echo $ECHO_N "checking for y0 in -lm... $ECHO_C" >&6
+if test "${ac_cv_lib_m_y0+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char y0 ();
+int
+main ()
+{
+y0 ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_m_y0=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_m_y0=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_m_y0" >&5
+echo "${ECHO_T}$ac_cv_lib_m_y0" >&6
+if test $ac_cv_lib_m_y0 = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_Y0 1
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking for y0f in -lm" >&5
+echo $ECHO_N "checking for y0f in -lm... $ECHO_C" >&6
+if test "${ac_cv_lib_m_y0f+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char y0f ();
+int
+main ()
+{
+y0f ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_m_y0f=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_m_y0f=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_m_y0f" >&5
+echo "${ECHO_T}$ac_cv_lib_m_y0f" >&6
+if test $ac_cv_lib_m_y0f = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_Y0F 1
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking for y1 in -lm" >&5
+echo $ECHO_N "checking for y1 in -lm... $ECHO_C" >&6
+if test "${ac_cv_lib_m_y1+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char y1 ();
+int
+main ()
+{
+y1 ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_m_y1=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_m_y1=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_m_y1" >&5
+echo "${ECHO_T}$ac_cv_lib_m_y1" >&6
+if test $ac_cv_lib_m_y1 = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_Y1 1
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking for y1f in -lm" >&5
+echo $ECHO_N "checking for y1f in -lm... $ECHO_C" >&6
+if test "${ac_cv_lib_m_y1f+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char y1f ();
+int
+main ()
+{
+y1f ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_m_y1f=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_m_y1f=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_m_y1f" >&5
+echo "${ECHO_T}$ac_cv_lib_m_y1f" >&6
+if test $ac_cv_lib_m_y1f = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_Y1F 1
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking for yn in -lm" >&5
+echo $ECHO_N "checking for yn in -lm... $ECHO_C" >&6
+if test "${ac_cv_lib_m_yn+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char yn ();
+int
+main ()
+{
+yn ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_m_yn=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_m_yn=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_m_yn" >&5
+echo "${ECHO_T}$ac_cv_lib_m_yn" >&6
+if test $ac_cv_lib_m_yn = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_YN 1
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking for ynf in -lm" >&5
+echo $ECHO_N "checking for ynf in -lm... $ECHO_C" >&6
+if test "${ac_cv_lib_m_ynf+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char ynf ();
+int
+main ()
+{
+ynf ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_m_ynf=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_m_ynf=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_m_ynf" >&5
+echo "${ECHO_T}$ac_cv_lib_m_ynf" >&6
+if test $ac_cv_lib_m_ynf = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_YNF 1
+_ACEOF
+
+fi
+
 
 # Let the user override this
 # Check whether --enable-cmath or --disable-cmath was given.
Index: libgfortran/configure.ac
===================================================================
RCS file: /var/cvsroot/gcc-cvs/gcc/libgfortran/configure.ac,v
retrieving revision 1.8
diff -u -p -r1.8 configure.ac
--- libgfortran/configure.ac	28 Aug 2004 23:43:41 -0000	1.8
+++ libgfortran/configure.ac	29 Aug 2004 15:14:43 -0000
@@ -166,6 +166,7 @@ AC_CHECK_LIB([c],[getpid],[AC_DEFINE([HA
 AC_CHECK_LIB([c],[getuid],[AC_DEFINE([HAVE_GETUID],[1],[libc includes getuid])])
 
 # Check for C99 (and other IEEE) math functions
+# ??? This list seems awful long. Is there a better way to test for these?
 AC_CHECK_LIB([m],[acosf],[AC_DEFINE([HAVE_ACOSF],[1],[libm includes acosf])])
 AC_CHECK_LIB([m],[asinf],[AC_DEFINE([HAVE_ASINF],[1],[libm includes asinf])])
 AC_CHECK_LIB([m],[atan2f],[AC_DEFINE([HAVE_ATAN2F],[1],[libm includes atan2f])])
@@ -190,6 +191,22 @@ AC_CHECK_LIB([m],[sinhf],[AC_DEFINE([HAV
 AC_CHECK_LIB([m],[sqrtf],[AC_DEFINE([HAVE_SQRTF],[1],[libm includes sqrtf])])
 AC_CHECK_LIB([m],[tanf],[AC_DEFINE([HAVE_TANF],[1],[libm includes tanf])])
 AC_CHECK_LIB([m],[tanhf],[AC_DEFINE([HAVE_TANHF],[1],[libm includes tanhf])])
+AC_CHECK_LIB([m],[erf],[AC_DEFINE([HAVE_ERF],[1],[libm includes erf])])
+AC_CHECK_LIB([m],[erfc],[AC_DEFINE([HAVE_ERFC],[1],[libm includes erfc])])
+AC_CHECK_LIB([m],[erfcf],[AC_DEFINE([HAVE_ERFCF],[1],[libm includes erfcf])])
+AC_CHECK_LIB([m],[erff],[AC_DEFINE([HAVE_ERFF],[1],[libm includes erff])])
+AC_CHECK_LIB([m],[j0],[AC_DEFINE([HAVE_J0],[1],[libm includes j0])])
+AC_CHECK_LIB([m],[j0f],[AC_DEFINE([HAVE_J0F],[1],[libm includes j0f])])
+AC_CHECK_LIB([m],[j1],[AC_DEFINE([HAVE_J1],[1],[libm includes j1])])
+AC_CHECK_LIB([m],[j1f],[AC_DEFINE([HAVE_J1F],[1],[libm includes j1f])])
+AC_CHECK_LIB([m],[jn],[AC_DEFINE([HAVE_JN],[1],[libm includes jn])])
+AC_CHECK_LIB([m],[jnf],[AC_DEFINE([HAVE_JNF],[1],[libm includes jnf])])
+AC_CHECK_LIB([m],[y0],[AC_DEFINE([HAVE_Y0],[1],[libm includes y0])])
+AC_CHECK_LIB([m],[y0f],[AC_DEFINE([HAVE_Y0F],[1],[libm includes y0f])])
+AC_CHECK_LIB([m],[y1],[AC_DEFINE([HAVE_Y1],[1],[libm includes y1])])
+AC_CHECK_LIB([m],[y1f],[AC_DEFINE([HAVE_Y1F],[1],[libm includes y1f])])
+AC_CHECK_LIB([m],[yn],[AC_DEFINE([HAVE_YN],[1],[libm includes yn])])
+AC_CHECK_LIB([m],[ynf],[AC_DEFINE([HAVE_YNF],[1],[libm includes ynf])])
 
 # Let the user override this
 AC_ARG_ENABLE(cmath,
Index: libgfortran/intrinsics/bessel.c
===================================================================
RCS file: libgfortran/intrinsics/bessel.c
diff -N libgfortran/intrinsics/bessel.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ libgfortran/intrinsics/bessel.c	29 Aug 2004 15:22:28 -0000
@@ -0,0 +1,72 @@
+/* Wrapper for systems without the various C99 single precision Bessel
+   functions.
+   Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+Libgfortran is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with libgfortran; see the file COPYING.LIB.  If not,
+write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+#include "config.h"
+#include <math.h>
+#include "libgfortran.h"
+
+/* Assume we have all or none of these.  */
+#if HAVE_J0 && !HAVE_J0F
+float
+j0f (float x)
+{
+  return (float) j0 ((double) x);
+}
+#endif
+
+#if HAVE_J1 && !HAVE_J1F
+float j1f (float x)
+{
+  return (float) j1 ((double) x);
+}
+#endif
+
+#if HAVE_JN && !HAVE_JNF
+float
+jnf (int n, float x)
+{
+  return (float) jn (n, (double) x);
+}
+#endif
+
+#if HAVE_Y0 && !HAVE_Y0F
+float
+y0f (float x)
+{
+  return (float) y0 ((double) x);
+}
+#endif
+
+#if HAVE_Y1 && !HAVE_Y1F
+float
+y1f (float x)
+{
+  return (float) y1 ((double) x);
+}
+#endif
+
+#if HAVE_YN && !HAVE_YNF
+float
+ynf (int n, float x)
+{
+  return (float) yn (n, (double) x);
+}
+#endif
Index: libgfortran/intrinsics/erf.c
===================================================================
RCS file: libgfortran/intrinsics/erf.c
diff -N libgfortran/intrinsics/erf.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ libgfortran/intrinsics/erf.c	29 Aug 2004 14:51:10 -0000
@@ -0,0 +1,39 @@
+/* Wrapper for systems without the C99 erff() and erfcf() functions
+   Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+Libgfortran is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with libgfortran; see the file COPYING.LIB.  If not,
+write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+#include "config.h"
+#include <math.h>
+#include "libgfortran.h"
+
+#if HAVE_ERF && !HAVE_ERFF
+float
+erff (float x)
+{
+  return (float) erf ((double) x);
+}
+#endif
+
+#if HAVE_ERFC && !HAVE_ERFCF
+float
+erfcf (float x)
+{
+  return (float) erfc ((double) x);
+}
+#endif

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]