aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fortran/ChangeLog23
-rw-r--r--gcc/fortran/gfortran.h1
-rw-r--r--gcc/fortran/intrinsic.c405
-rw-r--r--gcc/fortran/intrinsic.h1
-rw-r--r--gcc/fortran/intrinsic.texi2
-rw-r--r--gcc/fortran/iresolve.c26
-rw-r--r--gcc/fortran/resolve.c14
-rw-r--r--gcc/fortran/trans-decl.c11
-rw-r--r--gcc/testsuite/ChangeLog11
-rw-r--r--gcc/testsuite/gfortran.dg/specifics_1.f90106
-rw-r--r--gcc/testsuite/gfortran.dg/specifics_2.f9082
-rw-r--r--gcc/testsuite/gfortran.dg/specifics_3.f905
-rw-r--r--gcc/testsuite/gfortran.fortran-torture/execute/specifics.f90104
13 files changed, 592 insertions, 199 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 3015ff1..4a4b131 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,26 @@
+2006-10-07 Francois-Xavier Coudert <coudert@clipper.ens.fr>
+
+ PR fortran/16580
+ PR fortran/29288
+ * gcc/fortran/intrinsic.c (add_sym): Define the actual_ok when a
+ gfc_intrinsic_sym structure is filled.
+ (gfc_intrinsic_actual_ok): New function.
+ (add_sym_0s, add_sym_1s, add_sym_2s, add_sym_3s, add_sym_4s,
+ add_sym_5s): Intrinsic subroutines are not allowed as actual
+ arguments, so we remove argument actual_ok.
+ (add_functions): Correct the values for actual_ok of all intrinsics.
+ (add_subroutines): Remove the actual_ok argument, which was never used.
+ * gcc/fortran/intrinsic.h (gfc_intrinsic_actual_ok): New prototype.
+ * gcc/fortran/gfortran.h (gfc_resolve_index_func): New prototype.
+ * gcc/fortran/resolve.c (resolve_actual_arglist): Check whether
+ an intrinsic used as an argument list is allowed there.
+ * gcc/fortran/iresolve.c (gfc_resolve_index_func): New function.
+ (gfc_resolve_len): Change intrinsic function name to agree with
+ libgfortran.
+ * gcc/fortran/trans-decl.c (gfc_get_extern_function_decl): Add
+ new case, because some specific intrinsics take 3 arguments.
+ * gcc/fortran/intrinsic.texi: DIMAG is a GNU extension.
+
2006-10-06 Jakub Jelinek <jakub@redhat.com>
PR fortran/28415
diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h
index 0daa8f5..afc57db 100644
--- a/gcc/fortran/gfortran.h
+++ b/gcc/fortran/gfortran.h
@@ -1940,6 +1940,7 @@ try gfc_convert_type_warn (gfc_expr *, gfc_typespec *, int, int);
int gfc_generic_intrinsic (const char *);
int gfc_specific_intrinsic (const char *);
int gfc_intrinsic_name (const char *, int);
+int gfc_intrinsic_actual_ok (const char *, const bool);
gfc_intrinsic_sym *gfc_find_function (const char *);
match gfc_intrinsic_func_interface (gfc_expr *, int);
diff --git a/gcc/fortran/intrinsic.c b/gcc/fortran/intrinsic.c
index dd1ffeb..f2185b5 100644
--- a/gcc/fortran/intrinsic.c
+++ b/gcc/fortran/intrinsic.c
@@ -194,7 +194,7 @@ do_check (gfc_intrinsic_sym * specific, gfc_actual_arglist * arg)
Argument list:
char * name of function
int whether function is elemental
- int If the function can be used as an actual argument
+ int If the function can be used as an actual argument [1] [2]
bt return type of function
int kind of return type of function
int Fortran standard version
@@ -210,13 +210,20 @@ do_check (gfc_intrinsic_sym * specific, gfc_actual_arglist * arg)
The sequence is terminated by a NULL name.
- TODO: Are checks on actual_ok implemented elsewhere, or is that just
- missing here? */
+
+ [1] Whether a function can or cannot be used as an actual argument is
+ determined by its presence on the 13.6 list in Fortran 2003. The
+ following intrinsics, which are GNU extensions, are considered allowed
+ as actual arguments: ACOSH ATANH DACOSH DASINH DATANH DCONJG DIMAG
+ ZABS ZCOS ZEXP ZLOG ZSIN ZSQRT.
+ [2] The value 2 is used in this field for CHAR, which is allowed as an
+ actual argument in F2003, but not in F95. It is the only such
+ intrinsic function. */
static void
-add_sym (const char *name, int elemental, int actual_ok ATTRIBUTE_UNUSED,
- bt type, int kind, int standard, gfc_check_f check,
- gfc_simplify_f simplify, gfc_resolve_f resolve, ...)
+add_sym (const char *name, int elemental, int actual_ok, bt type, int kind,
+ int standard, gfc_check_f check, gfc_simplify_f simplify,
+ gfc_resolve_f resolve, ...)
{
char buf[GFC_MAX_SYMBOL_LEN + 11]; /* 10 for '_gfortran_', 1 for '\0' */
int optional, first_flag;
@@ -246,6 +253,7 @@ add_sym (const char *name, int elemental, int actual_ok ATTRIBUTE_UNUSED,
next_sym->lib_name = gfc_get_string (buf);
next_sym->elemental = elemental;
+ next_sym->actual_ok = actual_ok;
next_sym->ts.type = type;
next_sym->ts.kind = kind;
next_sym->standard = standard;
@@ -327,7 +335,7 @@ add_sym_0 (const char *name, int elemental, int actual_ok, bt type,
0 arguments. */
static void
-add_sym_0s (const char * name, int actual_ok, int standard,
+add_sym_0s (const char * name, int standard,
void (*resolve)(gfc_code *))
{
gfc_check_f cf;
@@ -338,7 +346,7 @@ add_sym_0s (const char * name, int actual_ok, int standard,
sf.f1 = NULL;
rf.s1 = resolve;
- add_sym (name, 1, actual_ok, BT_UNKNOWN, 0, standard, cf, sf, rf,
+ add_sym (name, 1, 0, BT_UNKNOWN, 0, standard, cf, sf, rf,
(void*)0);
}
@@ -372,7 +380,7 @@ add_sym_1 (const char *name, int elemental, int actual_ok, bt type,
1 arguments. */
static void
-add_sym_1s (const char *name, int elemental, int actual_ok, bt type,
+add_sym_1s (const char *name, int elemental, bt type,
int kind, int standard,
try (*check)(gfc_expr *),
gfc_expr *(*simplify)(gfc_expr *),
@@ -387,7 +395,7 @@ add_sym_1s (const char *name, int elemental, int actual_ok, bt type,
sf.f1 = simplify;
rf.s1 = resolve;
- add_sym (name, elemental, actual_ok, type, kind, standard, cf, sf, rf,
+ add_sym (name, elemental, 0, type, kind, standard, cf, sf, rf,
a1, type1, kind1, optional1,
(void*)0);
}
@@ -451,7 +459,7 @@ add_sym_2 (const char *name, int elemental, int actual_ok, bt type,
2 arguments. */
static void
-add_sym_2s (const char *name, int elemental, int actual_ok, bt type,
+add_sym_2s (const char *name, int elemental, bt type,
int kind, int standard,
try (*check)(gfc_expr *,gfc_expr *),
gfc_expr *(*simplify)(gfc_expr *,gfc_expr *),
@@ -467,7 +475,7 @@ add_sym_2s (const char *name, int elemental, int actual_ok, bt type,
sf.f2 = simplify;
rf.s1 = resolve;
- add_sym (name, elemental, actual_ok, type, kind, standard, cf, sf, rf,
+ add_sym (name, elemental, 0, type, kind, standard, cf, sf, rf,
a1, type1, kind1, optional1,
a2, type2, kind2, optional2,
(void*)0);
@@ -565,7 +573,7 @@ add_sym_3red (const char *name, int elemental,
3 arguments. */
static void
-add_sym_3s (const char *name, int elemental, int actual_ok, bt type,
+add_sym_3s (const char *name, int elemental, bt type,
int kind, int standard,
try (*check)(gfc_expr *,gfc_expr *,gfc_expr *),
gfc_expr *(*simplify)(gfc_expr *,gfc_expr *,gfc_expr *),
@@ -582,7 +590,7 @@ add_sym_3s (const char *name, int elemental, int actual_ok, bt type,
sf.f3 = simplify;
rf.s1 = resolve;
- add_sym (name, elemental, actual_ok, type, kind, standard, cf, sf, rf,
+ add_sym (name, elemental, 0, type, kind, standard, cf, sf, rf,
a1, type1, kind1, optional1,
a2, type2, kind2, optional2,
a3, type3, kind3, optional3,
@@ -625,7 +633,7 @@ add_sym_4 (const char *name, int elemental, int actual_ok, bt type,
4 arguments. */
static void
-add_sym_4s (const char *name, int elemental, int actual_ok,
+add_sym_4s (const char *name, int elemental,
bt type, int kind, int standard,
try (*check)(gfc_expr *,gfc_expr *,gfc_expr *,gfc_expr *),
gfc_expr *(*simplify)(gfc_expr *,gfc_expr *,gfc_expr *,gfc_expr *),
@@ -643,7 +651,7 @@ add_sym_4s (const char *name, int elemental, int actual_ok,
sf.f4 = simplify;
rf.s1 = resolve;
- add_sym (name, elemental, actual_ok, type, kind, standard, cf, sf, rf,
+ add_sym (name, elemental, 0, type, kind, standard, cf, sf, rf,
a1, type1, kind1, optional1,
a2, type2, kind2, optional2,
a3, type3, kind3, optional3,
@@ -656,7 +664,7 @@ add_sym_4s (const char *name, int elemental, int actual_ok,
5 arguments. */
static void
-add_sym_5s (const char *name, int elemental, int actual_ok,
+add_sym_5s (const char *name, int elemental,
bt type, int kind, int standard,
try (*check)(gfc_expr *,gfc_expr *,gfc_expr *,gfc_expr *,gfc_expr *),
gfc_expr *(*simplify)(gfc_expr *,gfc_expr *,gfc_expr *,gfc_expr *,gfc_expr *),
@@ -675,7 +683,7 @@ add_sym_5s (const char *name, int elemental, int actual_ok,
sf.f5 = simplify;
rf.s1 = resolve;
- add_sym (name, elemental, actual_ok, type, kind, standard, cf, sf, rf,
+ add_sym (name, elemental, 0, type, kind, standard, cf, sf, rf,
a1, type1, kind1, optional1,
a2, type2, kind2, optional2,
a3, type3, kind3, optional3,
@@ -759,6 +767,24 @@ gfc_specific_intrinsic (const char *name)
}
+/* Given a string, figure out if it is the name of an intrinsic function
+ or subroutine allowed as an actual argument or not. */
+int
+gfc_intrinsic_actual_ok (const char *name, const bool subroutine_flag)
+{
+ gfc_intrinsic_sym *sym;
+
+ /* Intrinsic subroutines are not allowed as actual arguments. */
+ if (subroutine_flag)
+ return 0;
+ else
+ {
+ sym = gfc_find_function (name);
+ return (sym == NULL) ? 0 : sym->actual_ok;
+ }
+}
+
+
/* Given a string, figure out if it is the name of an intrinsic
subroutine or function. There are no generic intrinsic
subroutines, they are all specific. */
@@ -916,13 +942,13 @@ add_functions (void)
make_generic ("abs", GFC_ISYM_ABS, GFC_STD_F77);
- add_sym_2 ("access", 0, 1, BT_INTEGER, di, GFC_STD_GNU,
+ add_sym_2 ("access", 0, 0, BT_INTEGER, di, GFC_STD_GNU,
gfc_check_access_func, NULL, gfc_resolve_access,
nm, BT_CHARACTER, dc, REQUIRED, md, BT_CHARACTER, dc, REQUIRED);
make_generic ("access", GFC_ISYM_ACCESS, GFC_STD_GNU);
- add_sym_1 ("achar", 1, 1, BT_CHARACTER, dc, GFC_STD_F95,
+ add_sym_1 ("achar", 1, 0, BT_CHARACTER, dc, GFC_STD_F95,
gfc_check_achar, gfc_simplify_achar, NULL,
i, BT_INTEGER, di, REQUIRED);
@@ -948,13 +974,13 @@ add_functions (void)
make_generic ("acosh", GFC_ISYM_ACOSH, GFC_STD_GNU);
- add_sym_1 ("adjustl", 1, 1, BT_CHARACTER, dc, GFC_STD_F95,
+ add_sym_1 ("adjustl", 1, 0, BT_CHARACTER, dc, GFC_STD_F95,
NULL, gfc_simplify_adjustl, NULL,
stg, BT_CHARACTER, dc, REQUIRED);
make_generic ("adjustl", GFC_ISYM_ADJUSTL, GFC_STD_F95);
- add_sym_1 ("adjustr", 1, 1, BT_CHARACTER, dc, GFC_STD_F95,
+ add_sym_1 ("adjustr", 1, 0, BT_CHARACTER, dc, GFC_STD_F95,
NULL, gfc_simplify_adjustr, NULL,
stg, BT_CHARACTER, dc, REQUIRED);
@@ -971,7 +997,6 @@ add_functions (void)
NULL, gfc_simplify_aimag, gfc_resolve_aimag,
z, BT_COMPLEX, dd, REQUIRED);
-
make_generic ("aimag", GFC_ISYM_AIMAG, GFC_STD_F77);
add_sym_2 ("aint", 1, 1, BT_REAL, dr, GFC_STD_F77,
@@ -984,13 +1009,13 @@ add_functions (void)
make_generic ("aint", GFC_ISYM_AINT, GFC_STD_F77);
- add_sym_2 ("all", 0, 1, BT_UNKNOWN, 0, GFC_STD_F95,
+ add_sym_2 ("all", 0, 0, BT_UNKNOWN, 0, GFC_STD_F95,
gfc_check_all_any, NULL, gfc_resolve_all,
msk, BT_LOGICAL, dl, REQUIRED, dm, BT_INTEGER, ii, OPTIONAL);
make_generic ("all", GFC_ISYM_ALL, GFC_STD_F95);
- add_sym_1 ("allocated", 0, 1, BT_LOGICAL, dl, GFC_STD_F95,
+ add_sym_1 ("allocated", 0, 0, BT_LOGICAL, dl, GFC_STD_F95,
gfc_check_allocated, NULL, NULL,
ar, BT_UNKNOWN, 0, REQUIRED);
@@ -1006,7 +1031,7 @@ add_functions (void)
make_generic ("anint", GFC_ISYM_ANINT, GFC_STD_F77);
- add_sym_2 ("any", 0, 1, BT_UNKNOWN, 0, GFC_STD_F95,
+ add_sym_2 ("any", 0, 0, BT_UNKNOWN, 0, GFC_STD_F95,
gfc_check_all_any, NULL, gfc_resolve_any,
msk, BT_LOGICAL, dl, REQUIRED, dm, BT_INTEGER, ii, OPTIONAL);
@@ -1032,7 +1057,7 @@ add_functions (void)
make_generic ("asinh", GFC_ISYM_ASINH, GFC_STD_GNU);
- add_sym_2 ("associated", 0, 1, BT_LOGICAL, dl, GFC_STD_F95,
+ add_sym_2 ("associated", 0, 0, BT_LOGICAL, dl, GFC_STD_F95,
gfc_check_associated, NULL, NULL,
pt, BT_UNKNOWN, 0, REQUIRED, tg, BT_UNKNOWN, 0, OPTIONAL);
@@ -1129,50 +1154,56 @@ add_functions (void)
make_generic ("besyn", GFC_ISYM_YN, GFC_STD_GNU);
- add_sym_1 ("bit_size", 0, 1, BT_INTEGER, di, GFC_STD_F95,
+ add_sym_1 ("bit_size", 0, 0, BT_INTEGER, di, GFC_STD_F95,
gfc_check_i, gfc_simplify_bit_size, NULL,
i, BT_INTEGER, di, REQUIRED);
make_generic ("bit_size", GFC_ISYM_NONE, GFC_STD_F95);
- add_sym_2 ("btest", 1, 1, BT_LOGICAL, dl, GFC_STD_F95,
+ add_sym_2 ("btest", 1, 0, BT_LOGICAL, dl, GFC_STD_F95,
gfc_check_btest, gfc_simplify_btest, gfc_resolve_btest,
i, BT_INTEGER, di, REQUIRED, pos, BT_INTEGER, di, REQUIRED);
make_generic ("btest", GFC_ISYM_BTEST, GFC_STD_F95);
- add_sym_2 ("ceiling", 1, 1, BT_INTEGER, di, GFC_STD_F95,
+ add_sym_2 ("ceiling", 1, 0, BT_INTEGER, di, GFC_STD_F95,
gfc_check_a_ikind, gfc_simplify_ceiling, gfc_resolve_ceiling,
a, BT_REAL, dr, REQUIRED, kind, BT_INTEGER, di, OPTIONAL);
make_generic ("ceiling", GFC_ISYM_CEILING, GFC_STD_F95);
- add_sym_2 ("char", 1, 0, BT_CHARACTER, dc, GFC_STD_F77,
+ add_sym_2 ("char", 1, 2, BT_CHARACTER, dc, GFC_STD_F77,
gfc_check_char, gfc_simplify_char, gfc_resolve_char,
i, BT_INTEGER, di, REQUIRED, kind, BT_INTEGER, di, OPTIONAL);
make_generic ("char", GFC_ISYM_CHAR, GFC_STD_F77);
- add_sym_1 ("chdir", 0, 1, BT_INTEGER, di, GFC_STD_GNU,
+ add_sym_1 ("chdir", 0, 0, BT_INTEGER, di, GFC_STD_GNU,
gfc_check_chdir, NULL, gfc_resolve_chdir,
a, BT_CHARACTER, dc, REQUIRED);
make_generic ("chdir", GFC_ISYM_CHDIR, GFC_STD_GNU);
- add_sym_2 ("chmod", 0, 1, BT_INTEGER, di, GFC_STD_GNU,
+ add_sym_2 ("chmod", 0, 0, BT_INTEGER, di, GFC_STD_GNU,
gfc_check_chmod, NULL, gfc_resolve_chmod,
nm, BT_CHARACTER, dc, REQUIRED, md, BT_CHARACTER, dc, REQUIRED);
make_generic ("chmod", GFC_ISYM_CHMOD, GFC_STD_GNU);
- add_sym_3 ("cmplx", 1, 1, BT_COMPLEX, dz, GFC_STD_F77,
+ add_sym_3 ("cmplx", 1, 0, BT_COMPLEX, dz, GFC_STD_F77,
gfc_check_cmplx, gfc_simplify_cmplx, gfc_resolve_cmplx,
x, BT_UNKNOWN, dr, REQUIRED, y, BT_UNKNOWN, dr, OPTIONAL,
kind, BT_INTEGER, di, OPTIONAL);
make_generic ("cmplx", GFC_ISYM_CMPLX, GFC_STD_F77);
- add_sym_2 ("complex", 1, 1, BT_COMPLEX, dz, GFC_STD_GNU,
+ add_sym_0 ("command_argument_count", 1, 0, BT_INTEGER, di, GFC_STD_F2003,
+ NULL, NULL, NULL);
+
+ make_generic ("command_argument_count", GFC_ISYM_COMMAND_ARGUMENT_COUNT,
+ GFC_STD_F2003);
+
+ add_sym_2 ("complex", 1, 0, BT_COMPLEX, dz, GFC_STD_GNU,
gfc_check_complex, gfc_simplify_complex, gfc_resolve_complex,
x, BT_UNKNOWN, dr, REQUIRED, y, BT_UNKNOWN, dr, REQUIRED);
@@ -1181,7 +1212,7 @@ add_functions (void)
/* Making dcmplx a specific of cmplx causes cmplx to return a double
complex instead of the default complex. */
- add_sym_2 ("dcmplx", 1, 1, BT_COMPLEX, dd, GFC_STD_GNU,
+ add_sym_2 ("dcmplx", 1, 0, BT_COMPLEX, dd, GFC_STD_GNU,
gfc_check_dcmplx, gfc_simplify_dcmplx, gfc_resolve_dcmplx,
x, BT_REAL, dd, REQUIRED, y, BT_REAL, dd, OPTIONAL);
@@ -1227,26 +1258,26 @@ add_functions (void)
make_generic ("cosh", GFC_ISYM_COSH, GFC_STD_F77);
- add_sym_2 ("count", 0, 1, BT_INTEGER, di, GFC_STD_F95,
+ add_sym_2 ("count", 0, 0, BT_INTEGER, di, GFC_STD_F95,
gfc_check_count, NULL, gfc_resolve_count,
msk, BT_LOGICAL, dl, REQUIRED, dm, BT_INTEGER, ii, OPTIONAL);
make_generic ("count", GFC_ISYM_COUNT, GFC_STD_F95);
- add_sym_3 ("cshift", 0, 1, BT_REAL, dr, GFC_STD_F95,
+ add_sym_3 ("cshift", 0, 0, BT_REAL, dr, GFC_STD_F95,
gfc_check_cshift, NULL, gfc_resolve_cshift,
ar, BT_REAL, dr, REQUIRED, sh, BT_INTEGER, di, REQUIRED,
dm, BT_INTEGER, ii, OPTIONAL);
make_generic ("cshift", GFC_ISYM_CSHIFT, GFC_STD_F95);
- add_sym_1 ("ctime", 0, 1, BT_CHARACTER, 0, GFC_STD_GNU,
+ add_sym_1 ("ctime", 0, 0, BT_CHARACTER, 0, GFC_STD_GNU,
gfc_check_ctime, NULL, gfc_resolve_ctime,
tm, BT_INTEGER, di, REQUIRED);
make_generic ("ctime", GFC_ISYM_CTIME, GFC_STD_GNU);
- add_sym_1 ("dble", 1, 1, BT_REAL, dd, GFC_STD_F77,
+ add_sym_1 ("dble", 1, 0, BT_REAL, dd, GFC_STD_F77,
gfc_check_dble, gfc_simplify_dble, gfc_resolve_dble,
a, BT_REAL, dr, REQUIRED);
@@ -1254,7 +1285,7 @@ add_functions (void)
make_generic ("dble", GFC_ISYM_DBLE, GFC_STD_F77);
- add_sym_1 ("digits", 0, 1, BT_INTEGER, di, GFC_STD_F95,
+ add_sym_1 ("digits", 0, 0, BT_INTEGER, di, GFC_STD_F95,
gfc_check_digits, gfc_simplify_digits, NULL,
x, BT_UNKNOWN, dr, REQUIRED);
@@ -1262,7 +1293,7 @@ add_functions (void)
add_sym_2 ("dim", 1, 1, BT_REAL, dr, GFC_STD_F77,
gfc_check_a_p, gfc_simplify_dim, gfc_resolve_dim,
- x, BT_UNKNOWN, dr, REQUIRED, y, BT_UNKNOWN, dr, REQUIRED);
+ x, BT_REAL, dr, REQUIRED, y, BT_UNKNOWN, dr, REQUIRED);
add_sym_2 ("idim", 1, 1, BT_INTEGER, di, GFC_STD_F77,
NULL, gfc_simplify_dim, gfc_resolve_dim,
@@ -1274,7 +1305,7 @@ add_functions (void)
make_generic ("dim", GFC_ISYM_DIM, GFC_STD_F77);
- add_sym_2 ("dot_product", 0, 1, BT_UNKNOWN, 0, GFC_STD_F95,
+ add_sym_2 ("dot_product", 0, 0, BT_UNKNOWN, 0, GFC_STD_F95,
gfc_check_dot_product, NULL, gfc_resolve_dot_product,
va, BT_REAL, dr, REQUIRED, vb, BT_REAL, dr, REQUIRED);
@@ -1292,14 +1323,14 @@ add_functions (void)
make_generic ("dreal", GFC_ISYM_REAL, GFC_STD_GNU);
- add_sym_4 ("eoshift", 0, 1, BT_REAL, dr, GFC_STD_F95,
+ add_sym_4 ("eoshift", 0, 0, BT_REAL, dr, GFC_STD_F95,
gfc_check_eoshift, NULL, gfc_resolve_eoshift,
ar, BT_REAL, dr, 0, sh, BT_INTEGER, ii, REQUIRED,
bd, BT_REAL, dr, 1, dm, BT_INTEGER, ii, OPTIONAL);
make_generic ("eoshift", GFC_ISYM_EOSHIFT, GFC_STD_F95);
- add_sym_1 ("epsilon", 0, 1, BT_REAL, dr, GFC_STD_F95,
+ add_sym_1 ("epsilon", 0, 0, BT_REAL, dr, GFC_STD_F95,
gfc_check_x, gfc_simplify_epsilon, NULL,
x, BT_REAL, dr, REQUIRED);
@@ -1327,7 +1358,7 @@ add_functions (void)
make_generic ("erfc", GFC_ISYM_ERFC, GFC_STD_GNU);
/* G77 compatibility */
- add_sym_1 ("etime", 0, 1, BT_REAL, 4, GFC_STD_GNU,
+ add_sym_1 ("etime", 0, 0, BT_REAL, 4, GFC_STD_GNU,
gfc_check_etime, NULL, NULL,
x, BT_REAL, 4, REQUIRED);
@@ -1355,7 +1386,7 @@ add_functions (void)
make_generic ("exp", GFC_ISYM_EXP, GFC_STD_F77);
- add_sym_1 ("exponent", 1, 1, BT_INTEGER, di, GFC_STD_F95,
+ add_sym_1 ("exponent", 1, 0, BT_INTEGER, di, GFC_STD_F95,
gfc_check_x, gfc_simplify_exponent, gfc_resolve_exponent,
x, BT_REAL, dr, REQUIRED);
@@ -1366,63 +1397,63 @@ add_functions (void)
make_generic ("fdate", GFC_ISYM_FDATE, GFC_STD_GNU);
- add_sym_2 ("floor", 1, 1, BT_INTEGER, di, GFC_STD_F95,
+ add_sym_2 ("floor", 1, 0, BT_INTEGER, di, GFC_STD_F95,
gfc_check_a_ikind, gfc_simplify_floor, gfc_resolve_floor,
a, BT_REAL, dr, REQUIRED, kind, BT_INTEGER, di, OPTIONAL);
make_generic ("floor", GFC_ISYM_FLOOR, GFC_STD_F95);
/* G77 compatible fnum */
- add_sym_1 ("fnum", 0, 1, BT_INTEGER, di, GFC_STD_GNU,
+ add_sym_1 ("fnum", 0, 0, BT_INTEGER, di, GFC_STD_GNU,
gfc_check_fnum, NULL, gfc_resolve_fnum,
ut, BT_INTEGER, di, REQUIRED);
make_generic ("fnum", GFC_ISYM_FNUM, GFC_STD_GNU);
- add_sym_1 ("fraction", 1, 1, BT_REAL, dr, GFC_STD_F95,
+ add_sym_1 ("fraction", 1, 0, BT_REAL, dr, GFC_STD_F95,
gfc_check_x, gfc_simplify_fraction, gfc_resolve_fraction,
x, BT_REAL, dr, REQUIRED);
make_generic ("fraction", GFC_ISYM_FRACTION, GFC_STD_F95);
- add_sym_2 ("fstat", 0, 1, BT_INTEGER, di, GFC_STD_GNU,
+ add_sym_2 ("fstat", 0, 0, BT_INTEGER, di, GFC_STD_GNU,
gfc_check_fstat, NULL, gfc_resolve_fstat,
a, BT_INTEGER, di, REQUIRED, b, BT_INTEGER, di, REQUIRED);
make_generic ("fstat", GFC_ISYM_FSTAT, GFC_STD_GNU);
- add_sym_1 ("ftell", 0, 1, BT_INTEGER, ii, GFC_STD_GNU,
+ add_sym_1 ("ftell", 0, 0, BT_INTEGER, ii, GFC_STD_GNU,
gfc_check_ftell, NULL, gfc_resolve_ftell,
ut, BT_INTEGER, di, REQUIRED);
make_generic ("ftell", GFC_ISYM_FTELL, GFC_STD_GNU);
- add_sym_2 ("fgetc", 0, 1, BT_INTEGER, di, GFC_STD_GNU,
+ add_sym_2 ("fgetc", 0, 0, BT_INTEGER, di, GFC_STD_GNU,
gfc_check_fgetputc, NULL, gfc_resolve_fgetc,
ut, BT_INTEGER, di, REQUIRED, c, BT_CHARACTER, dc, REQUIRED);
make_generic ("fgetc", GFC_ISYM_FGETC, GFC_STD_GNU);
- add_sym_1 ("fget", 0, 1, BT_INTEGER, di, GFC_STD_GNU,
+ add_sym_1 ("fget", 0, 0, BT_INTEGER, di, GFC_STD_GNU,
gfc_check_fgetput, NULL, gfc_resolve_fget,
c, BT_CHARACTER, dc, REQUIRED);
make_generic ("fget", GFC_ISYM_FGET, GFC_STD_GNU);
- add_sym_2 ("fputc", 0, 1, BT_INTEGER, di, GFC_STD_GNU,
+ add_sym_2 ("fputc", 0, 0, BT_INTEGER, di, GFC_STD_GNU,
gfc_check_fgetputc, NULL, gfc_resolve_fputc,
ut, BT_INTEGER, di, REQUIRED, c, BT_CHARACTER, dc, REQUIRED);
make_generic ("fputc", GFC_ISYM_FPUTC, GFC_STD_GNU);
- add_sym_1 ("fput", 0, 1, BT_INTEGER, di, GFC_STD_GNU,
+ add_sym_1 ("fput", 0, 0, BT_INTEGER, di, GFC_STD_GNU,
gfc_check_fgetput, NULL, gfc_resolve_fput,
c, BT_CHARACTER, dc, REQUIRED);
make_generic ("fput", GFC_ISYM_FPUT, GFC_STD_GNU);
/* Unix IDs (g77 compatibility) */
- add_sym_1 ("getcwd", 0, 1, BT_INTEGER, di, GFC_STD_GNU,
+ add_sym_1 ("getcwd", 0, 0, BT_INTEGER, di, GFC_STD_GNU,
NULL, NULL, gfc_resolve_getcwd,
c, BT_CHARACTER, dc, REQUIRED);
@@ -1443,25 +1474,25 @@ add_functions (void)
make_generic ("getuid", GFC_ISYM_GETUID, GFC_STD_GNU);
- add_sym_1 ("hostnm", 0, 1, BT_INTEGER, di, GFC_STD_GNU,
+ add_sym_1 ("hostnm", 0, 0, BT_INTEGER, di, GFC_STD_GNU,
gfc_check_hostnm, NULL, gfc_resolve_hostnm,
a, BT_CHARACTER, dc, REQUIRED);
make_generic ("hostnm", GFC_ISYM_HOSTNM, GFC_STD_GNU);
- add_sym_1 ("huge", 0, 1, BT_REAL, dr, GFC_STD_F95,
+ add_sym_1 ("huge", 0, 0, BT_REAL, dr, GFC_STD_F95,
gfc_check_huge, gfc_simplify_huge, NULL,
x, BT_UNKNOWN, dr, REQUIRED);
make_generic ("huge", GFC_ISYM_NONE, GFC_STD_F95);
- add_sym_1 ("iachar", 1, 1, BT_INTEGER, di, GFC_STD_F95,
+ add_sym_1 ("iachar", 1, 0, BT_INTEGER, di, GFC_STD_F95,
gfc_check_ichar_iachar, gfc_simplify_iachar, NULL,
c, BT_CHARACTER, dc, REQUIRED);
make_generic ("iachar", GFC_ISYM_IACHAR, GFC_STD_F95);
- add_sym_2 ("iand", 1, 1, BT_INTEGER, di, GFC_STD_F95,
+ add_sym_2 ("iand", 1, 0, BT_INTEGER, di, GFC_STD_F95,
gfc_check_iand, gfc_simplify_iand, gfc_resolve_iand,
i, BT_INTEGER, di, REQUIRED, j, BT_INTEGER, di, REQUIRED);
@@ -1473,31 +1504,25 @@ add_functions (void)
make_generic ("and", GFC_ISYM_AND, GFC_STD_GNU);
- add_sym_0 ("iargc", 1, 1, BT_INTEGER, di, GFC_STD_GNU,
+ add_sym_0 ("iargc", 1, 0, BT_INTEGER, di, GFC_STD_GNU,
NULL, NULL, NULL);
make_generic ("iargc", GFC_ISYM_IARGC, GFC_STD_GNU);
- add_sym_0 ("command_argument_count", 1, 1, BT_INTEGER, di, GFC_STD_F2003,
- NULL, NULL, NULL);
-
- make_generic ("command_argument_count", GFC_ISYM_COMMAND_ARGUMENT_COUNT,
- GFC_STD_F2003);
-
- add_sym_2 ("ibclr", 1, 1, BT_INTEGER, di, GFC_STD_F95,
+ add_sym_2 ("ibclr", 1, 0, BT_INTEGER, di, GFC_STD_F95,
gfc_check_ibclr, gfc_simplify_ibclr, gfc_resolve_ibclr,
i, BT_INTEGER, di, REQUIRED, pos, BT_INTEGER, di, REQUIRED);
make_generic ("ibclr", GFC_ISYM_IBCLR, GFC_STD_F95);
- add_sym_3 ("ibits", 1, 1, BT_INTEGER, di, GFC_STD_F95,
+ add_sym_3 ("ibits", 1, 0, BT_INTEGER, di, GFC_STD_F95,
gfc_check_ibits, gfc_simplify_ibits, gfc_resolve_ibits,
i, BT_INTEGER, di, REQUIRED, pos, BT_INTEGER, di, REQUIRED,
ln, BT_INTEGER, di, REQUIRED);
make_generic ("ibits", GFC_ISYM_IBITS, GFC_STD_F95);
- add_sym_2 ("ibset", 1, 1, BT_INTEGER, di, GFC_STD_F95,
+ add_sym_2 ("ibset", 1, 0, BT_INTEGER, di, GFC_STD_F95,
gfc_check_ibset, gfc_simplify_ibset, gfc_resolve_ibset,
i, BT_INTEGER, di, REQUIRED, pos, BT_INTEGER, di, REQUIRED);
@@ -1509,7 +1534,7 @@ add_functions (void)
make_generic ("ichar", GFC_ISYM_ICHAR, GFC_STD_F77);
- add_sym_2 ("ieor", 1, 1, BT_INTEGER, di, GFC_STD_F95,
+ add_sym_2 ("ieor", 1, 0, BT_INTEGER, di, GFC_STD_F95,
gfc_check_ieor, gfc_simplify_ieor, gfc_resolve_ieor,
i, BT_INTEGER, di, REQUIRED, j, BT_INTEGER, di, REQUIRED);
@@ -1527,13 +1552,13 @@ add_functions (void)
make_generic ("ierrno", GFC_ISYM_IERRNO, GFC_STD_GNU);
add_sym_3 ("index", 1, 1, BT_INTEGER, di, GFC_STD_F77,
- gfc_check_index, gfc_simplify_index, NULL,
+ gfc_check_index, gfc_simplify_index, gfc_resolve_index_func,
stg, BT_CHARACTER, dc, REQUIRED, ssg, BT_CHARACTER, dc, REQUIRED,
bck, BT_LOGICAL, dl, OPTIONAL);
make_generic ("index", GFC_ISYM_INDEX, GFC_STD_F77);
- add_sym_2 ("int", 1, 1, BT_INTEGER, di, GFC_STD_F77,
+ add_sym_2 ("int", 1, 0, BT_INTEGER, di, GFC_STD_F77,
gfc_check_int, gfc_simplify_int, gfc_resolve_int,
a, BT_REAL, dr, REQUIRED, kind, BT_INTEGER, di, OPTIONAL);
@@ -1567,7 +1592,7 @@ add_functions (void)
make_generic ("long", GFC_ISYM_LONG, GFC_STD_GNU);
- add_sym_2 ("ior", 1, 1, BT_INTEGER, di, GFC_STD_F95,
+ add_sym_2 ("ior", 1, 0, BT_INTEGER, di, GFC_STD_F95,
gfc_check_ior, gfc_simplify_ior, gfc_resolve_ior,
i, BT_INTEGER, di, REQUIRED, j, BT_INTEGER, di, REQUIRED);
@@ -1580,7 +1605,7 @@ add_functions (void)
make_generic ("or", GFC_ISYM_OR, GFC_STD_GNU);
/* The following function is for G77 compatibility. */
- add_sym_1 ("irand", 0, 1, BT_INTEGER, 4, GFC_STD_GNU,
+ add_sym_1 ("irand", 0, 0, BT_INTEGER, 4, GFC_STD_GNU,
gfc_check_irand, NULL, NULL,
i, BT_INTEGER, 4, OPTIONAL);
@@ -1592,44 +1617,44 @@ add_functions (void)
make_generic ("isatty", GFC_ISYM_ISATTY, GFC_STD_GNU);
- add_sym_2 ("rshift", 1, 1, BT_INTEGER, di, GFC_STD_GNU,
+ add_sym_2 ("rshift", 1, 0, BT_INTEGER, di, GFC_STD_GNU,
gfc_check_ishft, NULL, gfc_resolve_rshift,
i, BT_INTEGER, di, REQUIRED, sh, BT_INTEGER, di, REQUIRED);
make_generic ("rshift", GFC_ISYM_RSHIFT, GFC_STD_GNU);
- add_sym_2 ("lshift", 1, 1, BT_INTEGER, di, GFC_STD_GNU,
+ add_sym_2 ("lshift", 1, 0, BT_INTEGER, di, GFC_STD_GNU,
gfc_check_ishft, NULL, gfc_resolve_lshift,
i, BT_INTEGER, di, REQUIRED, sh, BT_INTEGER, di, REQUIRED);
make_generic ("lshift", GFC_ISYM_LSHIFT, GFC_STD_GNU);
- add_sym_2 ("ishft", 1, 1, BT_INTEGER, di, GFC_STD_F95,
+ add_sym_2 ("ishft", 1, 0, BT_INTEGER, di, GFC_STD_F95,
gfc_check_ishft, gfc_simplify_ishft, gfc_resolve_ishft,
i, BT_INTEGER, di, REQUIRED, sh, BT_INTEGER, di, REQUIRED);
make_generic ("ishft", GFC_ISYM_ISHFT, GFC_STD_F95);
- add_sym_3 ("ishftc", 1, 1, BT_INTEGER, di, GFC_STD_F95,
+ add_sym_3 ("ishftc", 1, 0, BT_INTEGER, di, GFC_STD_F95,
gfc_check_ishftc, gfc_simplify_ishftc, gfc_resolve_ishftc,
i, BT_INTEGER, di, REQUIRED, sh, BT_INTEGER, di, REQUIRED,
sz, BT_INTEGER, di, OPTIONAL);
make_generic ("ishftc", GFC_ISYM_ISHFTC, GFC_STD_F95);
- add_sym_2 ("kill", 1, 1, BT_INTEGER, di, GFC_STD_GNU,
+ add_sym_2 ("kill", 1, 0, BT_INTEGER, di, GFC_STD_GNU,
gfc_check_kill, NULL, gfc_resolve_kill,
a, BT_INTEGER, di, REQUIRED, b, BT_INTEGER, di, REQUIRED);
make_generic ("kill", GFC_ISYM_KILL, GFC_STD_GNU);
- add_sym_1 ("kind", 0, 1, BT_INTEGER, di, GFC_STD_F95,
+ add_sym_1 ("kind", 0, 0, BT_INTEGER, di, GFC_STD_F95,
gfc_check_kind, gfc_simplify_kind, NULL,
x, BT_REAL, dr, REQUIRED);
make_generic ("kind", GFC_ISYM_NONE, GFC_STD_F95);
- add_sym_2 ("lbound", 0, 1, BT_INTEGER, di, GFC_STD_F95,
+ add_sym_2 ("lbound", 0, 0, BT_INTEGER, di, GFC_STD_F95,
gfc_check_lbound, gfc_simplify_lbound, gfc_resolve_lbound,
ar, BT_REAL, dr, REQUIRED, dm, BT_INTEGER, di, OPTIONAL);
@@ -1641,7 +1666,7 @@ add_functions (void)
make_generic ("len", GFC_ISYM_LEN, GFC_STD_F77);
- add_sym_1 ("len_trim", 1, 1, BT_INTEGER, di, GFC_STD_F95,
+ add_sym_1 ("len_trim", 1, 0, BT_INTEGER, di, GFC_STD_F95,
NULL, gfc_simplify_len_trim, gfc_resolve_len_trim,
stg, BT_CHARACTER, dc, REQUIRED);
@@ -1673,13 +1698,13 @@ add_functions (void)
make_generic ("llt", GFC_ISYM_LLT, GFC_STD_F77);
- add_sym_2 ("link", 0, 1, BT_INTEGER, di, GFC_STD_GNU,
+ add_sym_2 ("link", 0, 0, BT_INTEGER, di, GFC_STD_GNU,
gfc_check_link, NULL, gfc_resolve_link,
a, BT_CHARACTER, dc, REQUIRED, b, BT_CHARACTER, dc, REQUIRED);
make_generic ("link", GFC_ISYM_LINK, GFC_STD_GNU);
- add_sym_1 ("log", 1, 1, BT_REAL, dr, GFC_STD_F77,
+ add_sym_1 ("log", 1, 0, BT_REAL, dr, GFC_STD_F77,
gfc_check_fn_rc, gfc_simplify_log, gfc_resolve_log,
x, BT_REAL, dr, REQUIRED);
@@ -1703,7 +1728,7 @@ add_functions (void)
make_generic ("log", GFC_ISYM_LOG, GFC_STD_F77);
- add_sym_1 ("log10", 1, 1, BT_REAL, dr, GFC_STD_F77,
+ add_sym_1 ("log10", 1, 0, BT_REAL, dr, GFC_STD_F77,
gfc_check_fn_r, gfc_simplify_log10, gfc_resolve_log10,
x, BT_REAL, dr, REQUIRED);
@@ -1717,24 +1742,24 @@ add_functions (void)
make_generic ("log10", GFC_ISYM_LOG10, GFC_STD_F77);
- add_sym_2 ("logical", 1, 1, BT_LOGICAL, dl, GFC_STD_F95,
+ add_sym_2 ("logical", 1, 0, BT_LOGICAL, dl, GFC_STD_F95,
gfc_check_logical, gfc_simplify_logical, gfc_resolve_logical,
l, BT_LOGICAL, dl, REQUIRED, kind, BT_INTEGER, di, OPTIONAL);
make_generic ("logical", GFC_ISYM_LOGICAL, GFC_STD_F95);
- add_sym_2 ("lstat", 0, 1, BT_INTEGER, di, GFC_STD_GNU,
+ add_sym_2 ("lstat", 0, 0, BT_INTEGER, di, GFC_STD_GNU,
gfc_check_stat, NULL, gfc_resolve_lstat,
a, BT_CHARACTER, dc, REQUIRED, b, BT_INTEGER, di, REQUIRED);
make_generic ("lstat", GFC_ISYM_LSTAT, GFC_STD_GNU);
- add_sym_1 ("malloc", 0, 1, BT_INTEGER, ii, GFC_STD_GNU, gfc_check_malloc,
+ add_sym_1 ("malloc", 0, 0, BT_INTEGER, ii, GFC_STD_GNU, gfc_check_malloc,
NULL, gfc_resolve_malloc, a, BT_INTEGER, di, REQUIRED);
make_generic ("malloc", GFC_ISYM_MALLOC, GFC_STD_GNU);
- add_sym_2 ("matmul", 0, 1, BT_REAL, dr, GFC_STD_F95,
+ add_sym_2 ("matmul", 0, 0, BT_REAL, dr, GFC_STD_F95,
gfc_check_matmul, NULL, gfc_resolve_matmul,
ma, BT_REAL, dr, REQUIRED, mb, BT_REAL, dr, REQUIRED);
@@ -1769,20 +1794,20 @@ add_functions (void)
make_generic ("max", GFC_ISYM_MAX, GFC_STD_F77);
- add_sym_1 ("maxexponent", 0, 1, BT_INTEGER, di, GFC_STD_F95,
+ add_sym_1 ("maxexponent", 0, 0, BT_INTEGER, di, GFC_STD_F95,
gfc_check_x, gfc_simplify_maxexponent, NULL,
x, BT_UNKNOWN, dr, REQUIRED);
make_generic ("maxexponent", GFC_ISYM_NONE, GFC_STD_F95);
- add_sym_3ml ("maxloc", 0, 1, BT_INTEGER, di, GFC_STD_F95,
+ add_sym_3ml ("maxloc", 0, 0, BT_INTEGER, di, GFC_STD_F95,
gfc_check_minloc_maxloc, NULL, gfc_resolve_maxloc,
ar, BT_REAL, dr, REQUIRED, dm, BT_INTEGER, ii, OPTIONAL,
msk, BT_LOGICAL, dl, OPTIONAL);
make_generic ("maxloc", GFC_ISYM_MAXLOC, GFC_STD_F95);
- add_sym_3red ("maxval", 0, 1, BT_REAL, dr, GFC_STD_F95,
+ add_sym_3red ("maxval", 0, 0, BT_REAL, dr, GFC_STD_F95,
gfc_check_minval_maxval, NULL, gfc_resolve_maxval,
ar, BT_REAL, dr, REQUIRED, dm, BT_INTEGER, ii, OPTIONAL,
msk, BT_LOGICAL, dl, OPTIONAL);
@@ -1799,7 +1824,7 @@ add_functions (void)
make_generic ("mclock8", GFC_ISYM_MCLOCK8, GFC_STD_GNU);
- add_sym_3 ("merge", 1, 1, BT_REAL, dr, GFC_STD_F95,
+ add_sym_3 ("merge", 1, 0, BT_REAL, dr, GFC_STD_F95,
gfc_check_merge, NULL, gfc_resolve_merge,
ts, BT_REAL, dr, REQUIRED, fs, BT_REAL, dr, REQUIRED,
msk, BT_LOGICAL, dl, REQUIRED);
@@ -1835,20 +1860,20 @@ add_functions (void)
make_generic ("min", GFC_ISYM_MIN, GFC_STD_F77);
- add_sym_1 ("minexponent", 0, 1, BT_INTEGER, di, GFC_STD_F95,
+ add_sym_1 ("minexponent", 0, 0, BT_INTEGER, di, GFC_STD_F95,
gfc_check_x, gfc_simplify_minexponent, NULL,
x, BT_UNKNOWN, dr, REQUIRED);
make_generic ("minexponent", GFC_ISYM_NONE, GFC_STD_F95);
- add_sym_3ml ("minloc", 0, 1, BT_INTEGER, di, GFC_STD_F95,
+ add_sym_3ml ("minloc", 0, 0, BT_INTEGER, di, GFC_STD_F95,
gfc_check_minloc_maxloc, NULL, gfc_resolve_minloc,
ar, BT_REAL, dr, REQUIRED, dm, BT_INTEGER, ii, OPTIONAL,
msk, BT_LOGICAL, dl, OPTIONAL);
make_generic ("minloc", GFC_ISYM_MINLOC, GFC_STD_F95);
- add_sym_3red ("minval", 0, 1, BT_REAL, dr, GFC_STD_F95,
+ add_sym_3red ("minval", 0, 0, BT_REAL, dr, GFC_STD_F95,
gfc_check_minval_maxval, NULL, gfc_resolve_minval,
ar, BT_REAL, dr, REQUIRED, dm, BT_INTEGER, ii, OPTIONAL,
msk, BT_LOGICAL, dl, OPTIONAL);
@@ -1875,7 +1900,7 @@ add_functions (void)
make_generic ("modulo", GFC_ISYM_MODULO, GFC_STD_F95);
- add_sym_2 ("nearest", 1, 1, BT_REAL, dr, GFC_STD_F95,
+ add_sym_2 ("nearest", 1, 0, BT_REAL, dr, GFC_STD_F95,
gfc_check_nearest, gfc_simplify_nearest, gfc_resolve_nearest,
x, BT_REAL, dr, REQUIRED, s, BT_REAL, dr, REQUIRED);
@@ -1891,52 +1916,52 @@ add_functions (void)
make_generic ("nint", GFC_ISYM_NINT, GFC_STD_F77);
- add_sym_1 ("not", 1, 1, BT_INTEGER, di, GFC_STD_F95,
+ add_sym_1 ("not", 1, 0, BT_INTEGER, di, GFC_STD_F95,
gfc_check_i, gfc_simplify_not, gfc_resolve_not,
i, BT_INTEGER, di, REQUIRED);
make_generic ("not", GFC_ISYM_NOT, GFC_STD_F95);
- add_sym_1 ("null", 0, 1, BT_INTEGER, di, GFC_STD_F95,
+ add_sym_1 ("null", 0, 0, BT_INTEGER, di, GFC_STD_F95,
gfc_check_null, gfc_simplify_null, NULL,
mo, BT_INTEGER, di, OPTIONAL);
make_generic ("null", GFC_ISYM_NONE, GFC_STD_F95);
- add_sym_3 ("pack", 0, 1, BT_REAL, dr, GFC_STD_F95,
+ add_sym_3 ("pack", 0, 0, BT_REAL, dr, GFC_STD_F95,
gfc_check_pack, NULL, gfc_resolve_pack,
ar, BT_REAL, dr, REQUIRED, msk, BT_LOGICAL, dl, REQUIRED,
v, BT_REAL, dr, OPTIONAL);
make_generic ("pack", GFC_ISYM_PACK, GFC_STD_F95);
- add_sym_1 ("precision", 0, 1, BT_INTEGER, di, GFC_STD_F95,
+ add_sym_1 ("precision", 0, 0, BT_INTEGER, di, GFC_STD_F95,
gfc_check_precision, gfc_simplify_precision, NULL,
x, BT_UNKNOWN, 0, REQUIRED);
make_generic ("precision", GFC_ISYM_NONE, GFC_STD_F95);
- add_sym_1 ("present", 0, 1, BT_LOGICAL, dl, GFC_STD_F95,
+ add_sym_1 ("present", 0, 0, BT_LOGICAL, dl, GFC_STD_F95,
gfc_check_present, NULL, NULL,
a, BT_REAL, dr, REQUIRED);
make_generic ("present", GFC_ISYM_PRESENT, GFC_STD_F95);
- add_sym_3red ("product", 0, 1, BT_REAL, dr, GFC_STD_F95,
+ add_sym_3red ("product", 0, 0, BT_REAL, dr, GFC_STD_F95,
gfc_check_product_sum, NULL, gfc_resolve_product,
ar, BT_REAL, dr, REQUIRED, dm, BT_INTEGER, ii, OPTIONAL,
msk, BT_LOGICAL, dl, OPTIONAL);
make_generic ("product", GFC_ISYM_PRODUCT, GFC_STD_F95);
- add_sym_1 ("radix", 0, 1, BT_INTEGER, di, GFC_STD_F95,
+ add_sym_1 ("radix", 0, 0, BT_INTEGER, di, GFC_STD_F95,
gfc_check_radix, gfc_simplify_radix, NULL,
x, BT_UNKNOWN, 0, REQUIRED);
make_generic ("radix", GFC_ISYM_NONE, GFC_STD_F95);
/* The following function is for G77 compatibility. */
- add_sym_1 ("rand", 0, 1, BT_REAL, 4, GFC_STD_GNU,
+ add_sym_1 ("rand", 0, 0, BT_REAL, 4, GFC_STD_GNU,
gfc_check_rand, NULL, NULL,
i, BT_INTEGER, 4, OPTIONAL);
@@ -1946,7 +1971,7 @@ add_functions (void)
make_generic ("rand", GFC_ISYM_RAND, GFC_STD_GNU);
- add_sym_1 ("range", 0, 1, BT_INTEGER, di, GFC_STD_F95,
+ add_sym_1 ("range", 0, 0, BT_INTEGER, di, GFC_STD_F95,
gfc_check_range, gfc_simplify_range, NULL,
x, BT_REAL, dr, REQUIRED);
@@ -1971,38 +1996,38 @@ add_functions (void)
make_generic ("real", GFC_ISYM_REAL, GFC_STD_F77);
- add_sym_2 ("rename", 0, 1, BT_INTEGER, di, GFC_STD_GNU,
+ add_sym_2 ("rename", 0, 0, BT_INTEGER, di, GFC_STD_GNU,
gfc_check_rename, NULL, gfc_resolve_rename,
a, BT_CHARACTER, dc, REQUIRED, b, BT_CHARACTER, dc, REQUIRED);
make_generic ("rename", GFC_ISYM_RENAME, GFC_STD_GNU);
- add_sym_2 ("repeat", 0, 1, BT_CHARACTER, dc, GFC_STD_F95,
+ add_sym_2 ("repeat", 0, 0, BT_CHARACTER, dc, GFC_STD_F95,
gfc_check_repeat, gfc_simplify_repeat, gfc_resolve_repeat,
stg, BT_CHARACTER, dc, REQUIRED, n, BT_INTEGER, di, REQUIRED);
make_generic ("repeat", GFC_ISYM_REPEAT, GFC_STD_F95);
- add_sym_4 ("reshape", 0, 1, BT_REAL, dr, GFC_STD_F95,
+ add_sym_4 ("reshape", 0, 0, BT_REAL, dr, GFC_STD_F95,
gfc_check_reshape, gfc_simplify_reshape, gfc_resolve_reshape,
src, BT_REAL, dr, REQUIRED, shp, BT_INTEGER, ii, REQUIRED,
pad, BT_REAL, dr, OPTIONAL, ord, BT_INTEGER, ii, OPTIONAL);
make_generic ("reshape", GFC_ISYM_RESHAPE, GFC_STD_F95);
- add_sym_1 ("rrspacing", 1, 1, BT_REAL, dr, GFC_STD_F95,
+ add_sym_1 ("rrspacing", 1, 0, BT_REAL, dr, GFC_STD_F95,
gfc_check_x, gfc_simplify_rrspacing, gfc_resolve_rrspacing,
x, BT_REAL, dr, REQUIRED);
make_generic ("rrspacing", GFC_ISYM_RRSPACING, GFC_STD_F95);
- add_sym_2 ("scale", 1, 1, BT_REAL, dr, GFC_STD_F95,
+ add_sym_2 ("scale", 1, 0, BT_REAL, dr, GFC_STD_F95,
gfc_check_scale, gfc_simplify_scale, gfc_resolve_scale,
x, BT_REAL, dr, REQUIRED, i, BT_INTEGER, di, REQUIRED);
make_generic ("scale", GFC_ISYM_SCALE, GFC_STD_F95);
- add_sym_3 ("scan", 1, 1, BT_INTEGER, di, GFC_STD_F95,
+ add_sym_3 ("scan", 1, 0, BT_INTEGER, di, GFC_STD_F95,
gfc_check_scan, gfc_simplify_scan, gfc_resolve_scan,
stg, BT_CHARACTER, dc, REQUIRED, set, BT_CHARACTER, dc, REQUIRED,
bck, BT_LOGICAL, dl, OPTIONAL);
@@ -2010,39 +2035,39 @@ add_functions (void)
make_generic ("scan", GFC_ISYM_SCAN, GFC_STD_F95);
/* Added for G77 compatibility garbage. */
- add_sym_0 ("second", 0, 1, BT_REAL, 4, GFC_STD_GNU,
+ add_sym_0 ("second", 0, 0, BT_REAL, 4, GFC_STD_GNU,
NULL, NULL, NULL);
make_generic ("second", GFC_ISYM_SECOND, GFC_STD_GNU);
/* Added for G77 compatibility. */
- add_sym_1 ("secnds", 0, 1, BT_REAL, dr, GFC_STD_GNU,
+ add_sym_1 ("secnds", 0, 0, BT_REAL, dr, GFC_STD_GNU,
gfc_check_secnds, NULL, gfc_resolve_secnds,
x, BT_REAL, dr, REQUIRED);
make_generic ("secnds", GFC_ISYM_SECNDS, GFC_STD_GNU);
- add_sym_1 ("selected_int_kind", 0, 1, BT_INTEGER, di, GFC_STD_F95,
+ add_sym_1 ("selected_int_kind", 0, 0, BT_INTEGER, di, GFC_STD_F95,
gfc_check_selected_int_kind, gfc_simplify_selected_int_kind, NULL,
r, BT_INTEGER, di, REQUIRED);
make_generic ("selected_int_kind", GFC_ISYM_SI_KIND, GFC_STD_F95);
- add_sym_2 ("selected_real_kind", 0, 1, BT_INTEGER, di, GFC_STD_F95,
+ add_sym_2 ("selected_real_kind", 0, 0, BT_INTEGER, di, GFC_STD_F95,
gfc_check_selected_real_kind, gfc_simplify_selected_real_kind,
NULL,
p, BT_INTEGER, di, OPTIONAL, r, BT_INTEGER, di, OPTIONAL);
make_generic ("selected_real_kind", GFC_ISYM_SR_KIND, GFC_STD_F95);
- add_sym_2 ("set_exponent", 1, 1, BT_REAL, dr, GFC_STD_F95,
+ add_sym_2 ("set_exponent", 1, 0, BT_REAL, dr, GFC_STD_F95,
gfc_check_set_exponent, gfc_simplify_set_exponent,
gfc_resolve_set_exponent,
x, BT_REAL, dr, REQUIRED, i, BT_INTEGER, di, REQUIRED);
make_generic ("set_exponent", GFC_ISYM_SET_EXPONENT, GFC_STD_F95);
- add_sym_1 ("shape", 0, 1, BT_INTEGER, di, GFC_STD_F95,
+ add_sym_1 ("shape", 0, 0, BT_INTEGER, di, GFC_STD_F95,
gfc_check_shape, gfc_simplify_shape, gfc_resolve_shape,
src, BT_REAL, dr, REQUIRED);
@@ -2062,7 +2087,7 @@ add_functions (void)
make_generic ("sign", GFC_ISYM_SIGN, GFC_STD_F77);
- add_sym_2 ("signal", 1, 1, BT_INTEGER, di, GFC_STD_GNU,
+ add_sym_2 ("signal", 1, 0, BT_INTEGER, di, GFC_STD_GNU,
gfc_check_signal, NULL, gfc_resolve_signal,
num, BT_INTEGER, di, REQUIRED, han, BT_UNKNOWN, 0, REQUIRED);
@@ -2098,19 +2123,19 @@ add_functions (void)
make_generic ("sinh", GFC_ISYM_SINH, GFC_STD_F77);
- add_sym_2 ("size", 0, 1, BT_INTEGER, di, GFC_STD_F95,
+ add_sym_2 ("size", 0, 0, BT_INTEGER, di, GFC_STD_F95,
gfc_check_size, gfc_simplify_size, NULL,
ar, BT_REAL, dr, REQUIRED, dm, BT_INTEGER, ii, OPTIONAL);
make_generic ("size", GFC_ISYM_SIZE, GFC_STD_F95);
- add_sym_1 ("spacing", 1, 1, BT_REAL, dr, GFC_STD_F95,
+ add_sym_1 ("spacing", 1, 0, BT_REAL, dr, GFC_STD_F95,
gfc_check_x, gfc_simplify_spacing, gfc_resolve_spacing,
x, BT_REAL, dr, REQUIRED);
make_generic ("spacing", GFC_ISYM_SPACING, GFC_STD_F95);
- add_sym_3 ("spread", 0, 1, BT_REAL, dr, GFC_STD_F95,
+ add_sym_3 ("spread", 0, 0, BT_REAL, dr, GFC_STD_F95,
gfc_check_spread, NULL, gfc_resolve_spread,
src, BT_REAL, dr, REQUIRED, dm, BT_INTEGER, ii, REQUIRED,
n, BT_INTEGER, di, REQUIRED);
@@ -2137,26 +2162,26 @@ add_functions (void)
make_generic ("sqrt", GFC_ISYM_SQRT, GFC_STD_F77);
- add_sym_2 ("stat", 0, 1, BT_INTEGER, di, GFC_STD_GNU,
+ add_sym_2 ("stat", 0, 0, BT_INTEGER, di, GFC_STD_GNU,
gfc_check_stat, NULL, gfc_resolve_stat,
a, BT_CHARACTER, dc, REQUIRED, b, BT_INTEGER, di, REQUIRED);
make_generic ("stat", GFC_ISYM_STAT, GFC_STD_GNU);
- add_sym_3red ("sum", 0, 1, BT_UNKNOWN, 0, GFC_STD_F95,
+ add_sym_3red ("sum", 0, 0, BT_UNKNOWN, 0, GFC_STD_F95,
gfc_check_product_sum, NULL, gfc_resolve_sum,
ar, BT_REAL, dr, REQUIRED, dm, BT_INTEGER, ii, OPTIONAL,
msk, BT_LOGICAL, dl, OPTIONAL);
make_generic ("sum", GFC_ISYM_SUM, GFC_STD_F95);
- add_sym_2 ("symlnk", 0, 1, BT_INTEGER, di, GFC_STD_GNU,
+ add_sym_2 ("symlnk", 0, 0, BT_INTEGER, di, GFC_STD_GNU,
gfc_check_symlnk, NULL, gfc_resolve_symlnk,
a, BT_CHARACTER, dc, REQUIRED, b, BT_CHARACTER, dc, REQUIRED);
make_generic ("symlnk", GFC_ISYM_SYMLNK, GFC_STD_GNU);
- add_sym_1 ("system", 1, 1, BT_INTEGER, di, GFC_STD_GNU,
+ add_sym_1 ("system", 1, 0, BT_INTEGER, di, GFC_STD_GNU,
NULL, NULL, NULL,
c, BT_CHARACTER, dc, REQUIRED);
@@ -2192,72 +2217,72 @@ add_functions (void)
make_generic ("time8", GFC_ISYM_TIME8, GFC_STD_GNU);
- add_sym_1 ("tiny", 0, 1, BT_REAL, dr, GFC_STD_F95,
+ add_sym_1 ("tiny", 0, 0, BT_REAL, dr, GFC_STD_F95,
gfc_check_x, gfc_simplify_tiny, NULL,
x, BT_REAL, dr, REQUIRED);
make_generic ("tiny", GFC_ISYM_NONE, GFC_STD_F95);
- add_sym_3 ("transfer", 0, 1, BT_REAL, dr, GFC_STD_F95,
+ add_sym_3 ("transfer", 0, 0, BT_REAL, dr, GFC_STD_F95,
gfc_check_transfer, gfc_simplify_transfer, gfc_resolve_transfer,
src, BT_REAL, dr, REQUIRED, mo, BT_REAL, dr, REQUIRED,
sz, BT_INTEGER, di, OPTIONAL);
make_generic ("transfer", GFC_ISYM_TRANSFER, GFC_STD_F95);
- add_sym_1 ("transpose", 0, 1, BT_REAL, dr, GFC_STD_F95,
+ add_sym_1 ("transpose", 0, 0, BT_REAL, dr, GFC_STD_F95,
gfc_check_transpose, NULL, gfc_resolve_transpose,
m, BT_REAL, dr, REQUIRED);
make_generic ("transpose", GFC_ISYM_TRANSPOSE, GFC_STD_F95);
- add_sym_1 ("trim", 0, 1, BT_CHARACTER, dc, GFC_STD_F95,
+ add_sym_1 ("trim", 0, 0, BT_CHARACTER, dc, GFC_STD_F95,
gfc_check_trim, gfc_simplify_trim, gfc_resolve_trim,
stg, BT_CHARACTER, dc, REQUIRED);
make_generic ("trim", GFC_ISYM_TRIM, GFC_STD_F95);
- add_sym_1 ("ttynam", 0, 1, BT_CHARACTER, 0, GFC_STD_GNU,
+ add_sym_1 ("ttynam", 0, 0, BT_CHARACTER, 0, GFC_STD_GNU,
gfc_check_ttynam, NULL, gfc_resolve_ttynam,
ut, BT_INTEGER, di, REQUIRED);
make_generic ("ttynam", GFC_ISYM_TTYNAM, GFC_STD_GNU);
- add_sym_2 ("ubound", 0, 1, BT_INTEGER, di, GFC_STD_F95,
+ add_sym_2 ("ubound", 0, 0, BT_INTEGER, di, GFC_STD_F95,
gfc_check_ubound, gfc_simplify_ubound, gfc_resolve_ubound,
ar, BT_REAL, dr, REQUIRED, dm, BT_INTEGER, ii, OPTIONAL);
make_generic ("ubound", GFC_ISYM_UBOUND, GFC_STD_F95);
/* g77 compatibility for UMASK. */
- add_sym_1 ("umask", 0, 1, BT_INTEGER, di, GFC_STD_GNU,
+ add_sym_1 ("umask", 0, 0, BT_INTEGER, di, GFC_STD_GNU,
gfc_check_umask, NULL, gfc_resolve_umask,
a, BT_INTEGER, di, REQUIRED);
make_generic ("umask", GFC_ISYM_UMASK, GFC_STD_GNU);
/* g77 compatibility for UNLINK. */
- add_sym_1 ("unlink", 0, 1, BT_INTEGER, di, GFC_STD_GNU,
+ add_sym_1 ("unlink", 0, 0, BT_INTEGER, di, GFC_STD_GNU,
gfc_check_unlink, NULL, gfc_resolve_unlink,
a, BT_CHARACTER, dc, REQUIRED);
make_generic ("unlink", GFC_ISYM_UNLINK, GFC_STD_GNU);
- add_sym_3 ("unpack", 0, 1, BT_REAL, dr, GFC_STD_F95,
+ add_sym_3 ("unpack", 0, 0, BT_REAL, dr, GFC_STD_F95,
gfc_check_unpack, NULL, gfc_resolve_unpack,
v, BT_REAL, dr, REQUIRED, msk, BT_LOGICAL, dl, REQUIRED,
f, BT_REAL, dr, REQUIRED);
make_generic ("unpack", GFC_ISYM_UNPACK, GFC_STD_F95);
- add_sym_3 ("verify", 1, 1, BT_INTEGER, di, GFC_STD_F95,
+ add_sym_3 ("verify", 1, 0, BT_INTEGER, di, GFC_STD_F95,
gfc_check_verify, gfc_simplify_verify, gfc_resolve_verify,
stg, BT_CHARACTER, dc, REQUIRED, set, BT_CHARACTER, dc, REQUIRED,
bck, BT_LOGICAL, dl, OPTIONAL);
make_generic ("verify", GFC_ISYM_VERIFY, GFC_STD_F95);
- add_sym_1 ("loc", 0, 1, BT_INTEGER, ii, GFC_STD_GNU,
+ add_sym_1 ("loc", 0, 0, BT_INTEGER, ii, GFC_STD_GNU,
gfc_check_loc, NULL, gfc_resolve_loc,
ar, BT_UNKNOWN, 0, REQUIRED);
@@ -2290,237 +2315,237 @@ add_subroutines (void)
dl = gfc_default_logical_kind;
ii = gfc_index_integer_kind;
- add_sym_0s ("abort", 1, GFC_STD_GNU, NULL);
+ add_sym_0s ("abort", GFC_STD_GNU, NULL);
if ((gfc_option.allow_std & GFC_STD_GNU) || gfc_option.flag_all_intrinsics)
make_noreturn();
- add_sym_1s ("cpu_time", 0, 1, BT_UNKNOWN, 0, GFC_STD_F95,
+ add_sym_1s ("cpu_time", 0, BT_UNKNOWN, 0, GFC_STD_F95,
gfc_check_cpu_time, NULL, gfc_resolve_cpu_time,
tm, BT_REAL, dr, REQUIRED);
/* More G77 compatibility garbage. */
- add_sym_2s ("ctime", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ add_sym_2s ("ctime", 0, BT_UNKNOWN, 0, GFC_STD_GNU,
gfc_check_ctime_sub, NULL, gfc_resolve_ctime_sub,
tm, BT_INTEGER, di, REQUIRED, res, BT_CHARACTER, dc, REQUIRED);
- add_sym_1s ("idate", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ add_sym_1s ("idate", 0, BT_UNKNOWN, 0, GFC_STD_GNU,
gfc_check_itime_idate, NULL, gfc_resolve_idate,
vl, BT_INTEGER, 4, REQUIRED);
- add_sym_1s ("itime", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ add_sym_1s ("itime", 0, BT_UNKNOWN, 0, GFC_STD_GNU,
gfc_check_itime_idate, NULL, gfc_resolve_itime,
vl, BT_INTEGER, 4, REQUIRED);
- add_sym_2s ("ltime", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ add_sym_2s ("ltime", 0, BT_UNKNOWN, 0, GFC_STD_GNU,
gfc_check_ltime_gmtime, NULL, gfc_resolve_ltime,
tm, BT_INTEGER, di, REQUIRED, vl, BT_INTEGER, di, REQUIRED);
- add_sym_2s ("gmtime", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ add_sym_2s ("gmtime", 0, BT_UNKNOWN, 0, GFC_STD_GNU,
gfc_check_ltime_gmtime, NULL, gfc_resolve_gmtime,
tm, BT_INTEGER, di, REQUIRED, vl, BT_INTEGER, di, REQUIRED);
- add_sym_1s ("second", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ add_sym_1s ("second", 0, BT_UNKNOWN, 0, GFC_STD_GNU,
gfc_check_second_sub, NULL, gfc_resolve_second_sub,
tm, BT_REAL, dr, REQUIRED);
- add_sym_2s ("chdir", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ add_sym_2s ("chdir", 0, BT_UNKNOWN, 0, GFC_STD_GNU,
gfc_check_chdir_sub, NULL, gfc_resolve_chdir_sub,
name, BT_CHARACTER, dc, REQUIRED, st, BT_INTEGER, di, OPTIONAL);
- add_sym_3s ("chmod", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ add_sym_3s ("chmod", 0, BT_UNKNOWN, 0, GFC_STD_GNU,
gfc_check_chmod_sub, NULL, gfc_resolve_chmod_sub,
name, BT_CHARACTER, dc, REQUIRED, md, BT_CHARACTER, dc, REQUIRED,
st, BT_INTEGER, di, OPTIONAL);
- add_sym_4s ("date_and_time", 0, 1, BT_UNKNOWN, 0, GFC_STD_F95,
+ add_sym_4s ("date_and_time", 0, BT_UNKNOWN, 0, GFC_STD_F95,
gfc_check_date_and_time, NULL, NULL,
dt, BT_CHARACTER, dc, OPTIONAL, tm, BT_CHARACTER, dc, OPTIONAL,
zn, BT_CHARACTER, dc, OPTIONAL, vl, BT_INTEGER, di, OPTIONAL);
/* More G77 compatibility garbage. */
- add_sym_2s ("etime", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ add_sym_2s ("etime", 0, BT_UNKNOWN, 0, GFC_STD_GNU,
gfc_check_etime_sub, NULL, gfc_resolve_etime_sub,
vl, BT_REAL, 4, REQUIRED, tm, BT_REAL, 4, REQUIRED);
- add_sym_2s ("dtime", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ add_sym_2s ("dtime", 0, BT_UNKNOWN, 0, GFC_STD_GNU,
gfc_check_etime_sub, NULL, gfc_resolve_etime_sub,
vl, BT_REAL, 4, REQUIRED, tm, BT_REAL, 4, REQUIRED);
- add_sym_1s ("fdate", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ add_sym_1s ("fdate", 0, BT_UNKNOWN, 0, GFC_STD_GNU,
gfc_check_fdate_sub, NULL, gfc_resolve_fdate_sub,
dt, BT_CHARACTER, dc, REQUIRED);
- add_sym_1s ("gerror", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ add_sym_1s ("gerror", 0, BT_UNKNOWN, 0, GFC_STD_GNU,
gfc_check_gerror, NULL, gfc_resolve_gerror, c, BT_CHARACTER,
dc, REQUIRED);
- add_sym_2s ("getcwd", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ add_sym_2s ("getcwd", 0, BT_UNKNOWN, 0, GFC_STD_GNU,
gfc_check_getcwd_sub, NULL, gfc_resolve_getcwd_sub,
c, BT_CHARACTER, dc, REQUIRED, st, BT_INTEGER, di, OPTIONAL);
- add_sym_2s ("getenv", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ add_sym_2s ("getenv", 0, BT_UNKNOWN, 0, GFC_STD_GNU,
NULL, NULL, NULL,
name, BT_CHARACTER, dc, REQUIRED, val, BT_CHARACTER, dc, REQUIRED);
- add_sym_2s ("getarg", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ add_sym_2s ("getarg", 0, BT_UNKNOWN, 0, GFC_STD_GNU,
NULL, NULL, gfc_resolve_getarg,
c, BT_INTEGER, di, REQUIRED, vl, BT_CHARACTER, dc, REQUIRED);
- add_sym_1s ("getlog", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ add_sym_1s ("getlog", 0, BT_UNKNOWN, 0, GFC_STD_GNU,
gfc_check_getlog, NULL, gfc_resolve_getlog, c, BT_CHARACTER,
dc, REQUIRED);
/* F2003 commandline routines. */
- add_sym_3s ("get_command", 0, 1, BT_UNKNOWN, 0, GFC_STD_F2003,
+ add_sym_3s ("get_command", 0, BT_UNKNOWN, 0, GFC_STD_F2003,
NULL, NULL, gfc_resolve_get_command,
com, BT_CHARACTER, dc, OPTIONAL, length, BT_INTEGER, di, OPTIONAL,
st, BT_INTEGER, di, OPTIONAL);
- add_sym_4s ("get_command_argument", 0, 1, BT_UNKNOWN, 0, GFC_STD_F2003,
+ add_sym_4s ("get_command_argument", 0, BT_UNKNOWN, 0, GFC_STD_F2003,
NULL, NULL, gfc_resolve_get_command_argument,
num, BT_INTEGER, di, REQUIRED, val, BT_CHARACTER, dc, OPTIONAL,
length, BT_INTEGER, di, OPTIONAL, st, BT_INTEGER, di, OPTIONAL);
/* F2003 subroutine to get environment variables. */
- add_sym_5s ("get_environment_variable", 0, 1, BT_UNKNOWN, 0, GFC_STD_F2003,
+ add_sym_5s ("get_environment_variable", 0, BT_UNKNOWN, 0, GFC_STD_F2003,
NULL, NULL, gfc_resolve_get_environment_variable,
name, BT_CHARACTER, dc, REQUIRED, val, BT_CHARACTER, dc, OPTIONAL,
length, BT_INTEGER, di, OPTIONAL, st, BT_INTEGER, di, OPTIONAL,
trim_name, BT_LOGICAL, dl, OPTIONAL);
- add_sym_5s ("mvbits", 1, 1, BT_UNKNOWN, 0, GFC_STD_F95,
+ add_sym_5s ("mvbits", 1, BT_UNKNOWN, 0, GFC_STD_F95,
gfc_check_mvbits, gfc_simplify_mvbits, gfc_resolve_mvbits,
f, BT_INTEGER, di, REQUIRED, fp, BT_INTEGER, di, REQUIRED,
ln, BT_INTEGER, di, REQUIRED, t, BT_INTEGER, di, REQUIRED,
tp, BT_INTEGER, di, REQUIRED);
- add_sym_1s ("random_number", 0, 1, BT_UNKNOWN, 0, GFC_STD_F95,
+ add_sym_1s ("random_number", 0, BT_UNKNOWN, 0, GFC_STD_F95,
gfc_check_random_number, NULL, gfc_resolve_random_number,
h, BT_REAL, dr, REQUIRED);
- add_sym_3s ("random_seed", 0, 1, BT_UNKNOWN, 0, GFC_STD_F95,
+ add_sym_3s ("random_seed", 0, BT_UNKNOWN, 0, GFC_STD_F95,
gfc_check_random_seed, NULL, NULL,
sz, BT_INTEGER, di, OPTIONAL, pt, BT_INTEGER, di, OPTIONAL,
gt, BT_INTEGER, di, OPTIONAL);
/* More G77 compatibility garbage. */
- add_sym_3s ("alarm", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ add_sym_3s ("alarm", 0, BT_UNKNOWN, 0, GFC_STD_GNU,
gfc_check_alarm_sub, NULL, gfc_resolve_alarm_sub,
sec, BT_INTEGER, di, REQUIRED, han, BT_UNKNOWN, 0, REQUIRED,
st, BT_INTEGER, di, OPTIONAL);
- add_sym_1s ("srand", 0, 1, BT_UNKNOWN, di, GFC_STD_GNU,
+ add_sym_1s ("srand", 0, BT_UNKNOWN, di, GFC_STD_GNU,
gfc_check_srand, NULL, gfc_resolve_srand,
c, BT_INTEGER, 4, REQUIRED);
- add_sym_1s ("exit", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ add_sym_1s ("exit", 0, BT_UNKNOWN, 0, GFC_STD_GNU,
gfc_check_exit, NULL, gfc_resolve_exit,
c, BT_INTEGER, di, OPTIONAL);
if ((gfc_option.allow_std & GFC_STD_GNU) || gfc_option.flag_all_intrinsics)
make_noreturn();
- add_sym_3s ("fgetc", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ add_sym_3s ("fgetc", 0, BT_UNKNOWN, 0, GFC_STD_GNU,
gfc_check_fgetputc_sub, NULL, gfc_resolve_fgetc_sub,
ut, BT_INTEGER, di, REQUIRED, c, BT_CHARACTER, dc, REQUIRED,
st, BT_INTEGER, di, OPTIONAL);
- add_sym_2s ("fget", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ add_sym_2s ("fget", 0, BT_UNKNOWN, 0, GFC_STD_GNU,
gfc_check_fgetput_sub, NULL, gfc_resolve_fget_sub,
c, BT_CHARACTER, dc, REQUIRED, st, BT_INTEGER, di, OPTIONAL);
- add_sym_1s ("flush", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ add_sym_1s ("flush", 0, BT_UNKNOWN, 0, GFC_STD_GNU,
gfc_check_flush, NULL, gfc_resolve_flush,
c, BT_INTEGER, di, OPTIONAL);
- add_sym_3s ("fputc", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ add_sym_3s ("fputc", 0, BT_UNKNOWN, 0, GFC_STD_GNU,
gfc_check_fgetputc_sub, NULL, gfc_resolve_fputc_sub,
ut, BT_INTEGER, di, REQUIRED, c, BT_CHARACTER, dc, REQUIRED,
st, BT_INTEGER, di, OPTIONAL);
- add_sym_2s ("fput", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ add_sym_2s ("fput", 0, BT_UNKNOWN, 0, GFC_STD_GNU,
gfc_check_fgetput_sub, NULL, gfc_resolve_fput_sub,
c, BT_CHARACTER, dc, REQUIRED, st, BT_INTEGER, di, OPTIONAL);
- add_sym_1s ("free", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU, gfc_check_free,
+ add_sym_1s ("free", 0, BT_UNKNOWN, 0, GFC_STD_GNU, gfc_check_free,
NULL, gfc_resolve_free, c, BT_INTEGER, ii, REQUIRED);
- add_sym_2s ("ftell", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ add_sym_2s ("ftell", 0, BT_UNKNOWN, 0, GFC_STD_GNU,
gfc_check_ftell_sub, NULL, gfc_resolve_ftell_sub,
ut, BT_INTEGER, di, REQUIRED, of, BT_INTEGER, ii, REQUIRED);
- add_sym_2s ("hostnm", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ add_sym_2s ("hostnm", 0, BT_UNKNOWN, 0, GFC_STD_GNU,
gfc_check_hostnm_sub, NULL, gfc_resolve_hostnm_sub,
c, BT_CHARACTER, dc, REQUIRED, st, BT_INTEGER, di, OPTIONAL);
- add_sym_3s ("kill", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU, gfc_check_kill_sub,
+ add_sym_3s ("kill", 0, BT_UNKNOWN, 0, GFC_STD_GNU, gfc_check_kill_sub,
NULL, gfc_resolve_kill_sub, c, BT_INTEGER, di, REQUIRED,
val, BT_INTEGER, di, REQUIRED, st, BT_INTEGER, di, OPTIONAL);
- add_sym_3s ("link", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ add_sym_3s ("link", 0, BT_UNKNOWN, 0, GFC_STD_GNU,
gfc_check_link_sub, NULL, gfc_resolve_link_sub,
name, BT_CHARACTER, dc, REQUIRED, val, BT_CHARACTER,
dc, REQUIRED, st, BT_INTEGER, di, OPTIONAL);
- add_sym_1s ("perror", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ add_sym_1s ("perror", 0, BT_UNKNOWN, 0, GFC_STD_GNU,
gfc_check_perror, NULL, gfc_resolve_perror,
c, BT_CHARACTER, dc, REQUIRED);
- add_sym_3s ("rename", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ add_sym_3s ("rename", 0, BT_UNKNOWN, 0, GFC_STD_GNU,
gfc_check_rename_sub, NULL, gfc_resolve_rename_sub,
name, BT_CHARACTER, dc, REQUIRED, val, BT_CHARACTER,
dc, REQUIRED, st, BT_INTEGER, di, OPTIONAL);
- add_sym_1s ("sleep", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ add_sym_1s ("sleep", 0, BT_UNKNOWN, 0, GFC_STD_GNU,
gfc_check_sleep_sub, NULL, gfc_resolve_sleep_sub,
val, BT_CHARACTER, dc, REQUIRED);
- add_sym_3s ("fstat", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ add_sym_3s ("fstat", 0, BT_UNKNOWN, 0, GFC_STD_GNU,
gfc_check_fstat_sub, NULL, gfc_resolve_fstat_sub,
ut, BT_INTEGER, di, REQUIRED, vl, BT_INTEGER, di, REQUIRED,
st, BT_INTEGER, di, OPTIONAL);
- add_sym_3s ("lstat", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ add_sym_3s ("lstat", 0, BT_UNKNOWN, 0, GFC_STD_GNU,
gfc_check_stat_sub, NULL, gfc_resolve_lstat_sub,
name, BT_CHARACTER, dc, REQUIRED, vl, BT_INTEGER, di, REQUIRED,
st, BT_INTEGER, di, OPTIONAL);
- add_sym_3s ("stat", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ add_sym_3s ("stat", 0, BT_UNKNOWN, 0, GFC_STD_GNU,
gfc_check_stat_sub, NULL, gfc_resolve_stat_sub,
name, BT_CHARACTER, dc, REQUIRED, vl, BT_INTEGER, di, REQUIRED,
st, BT_INTEGER, di, OPTIONAL);
- add_sym_3s ("signal", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ add_sym_3s ("signal", 0, BT_UNKNOWN, 0, GFC_STD_GNU,
gfc_check_signal_sub, NULL, gfc_resolve_signal_sub,
num, BT_INTEGER, di, REQUIRED, han, BT_UNKNOWN, 0, REQUIRED,
st, BT_INTEGER, di, OPTIONAL);
- add_sym_3s ("symlnk", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ add_sym_3s ("symlnk", 0, BT_UNKNOWN, 0, GFC_STD_GNU,
gfc_check_symlnk_sub, NULL, gfc_resolve_symlnk_sub,
name, BT_CHARACTER, dc, REQUIRED, val, BT_CHARACTER,
dc, REQUIRED, st, BT_INTEGER, di, OPTIONAL);
- add_sym_2s ("system", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ add_sym_2s ("system", 0, BT_UNKNOWN, 0, GFC_STD_GNU,
NULL, NULL, gfc_resolve_system_sub,
c, BT_CHARACTER, dc, REQUIRED, st, BT_INTEGER, di, OPTIONAL);
- add_sym_3s ("system_clock", 0, 1, BT_UNKNOWN, 0, GFC_STD_F95,
+ add_sym_3s ("system_clock", 0, BT_UNKNOWN, 0, GFC_STD_F95,
gfc_check_system_clock, NULL, gfc_resolve_system_clock,
c, BT_INTEGER, di, OPTIONAL, cr, BT_INTEGER, di, OPTIONAL,
cm, BT_INTEGER, di, OPTIONAL);
- add_sym_2s ("ttynam", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ add_sym_2s ("ttynam", 0, BT_UNKNOWN, 0, GFC_STD_GNU,
gfc_check_ttynam_sub, NULL, gfc_resolve_ttynam_sub,
ut, BT_INTEGER, di, REQUIRED, c, BT_CHARACTER, dc, REQUIRED);
- add_sym_2s ("umask", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ add_sym_2s ("umask", 0, BT_UNKNOWN, 0, GFC_STD_GNU,
gfc_check_umask_sub, NULL, gfc_resolve_umask_sub,
val, BT_INTEGER, di, REQUIRED, num, BT_INTEGER, di, OPTIONAL);
- add_sym_2s ("unlink", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ add_sym_2s ("unlink", 0, BT_UNKNOWN, 0, GFC_STD_GNU,
gfc_check_unlink_sub, NULL, gfc_resolve_unlink_sub,
c, BT_CHARACTER, dc, REQUIRED, st, BT_INTEGER, di, OPTIONAL);
diff --git a/gcc/fortran/intrinsic.h b/gcc/fortran/intrinsic.h
index 1f2c069..3e7ad39 100644
--- a/gcc/fortran/intrinsic.h
+++ b/gcc/fortran/intrinsic.h
@@ -357,6 +357,7 @@ void gfc_resolve_iand (gfc_expr *, gfc_expr *, gfc_expr *);
void gfc_resolve_ibclr (gfc_expr *, gfc_expr *, gfc_expr *);
void gfc_resolve_ibits (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
void gfc_resolve_ibset (gfc_expr *, gfc_expr *, gfc_expr *);
+void gfc_resolve_index_func (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
void gfc_resolve_ierrno (gfc_expr *);
void gfc_resolve_ieor (gfc_expr *, gfc_expr *, gfc_expr *);
void gfc_resolve_ichar (gfc_expr *, gfc_expr *);
diff --git a/gcc/fortran/intrinsic.texi b/gcc/fortran/intrinsic.texi
index 31d1f1f..e3d8cc8 100644
--- a/gcc/fortran/intrinsic.texi
+++ b/gcc/fortran/intrinsic.texi
@@ -667,7 +667,7 @@ end program test_aimag
@item @emph{Specific names}:
@multitable @columnfractions .20 .20 .20 .40
@item Name @tab Argument @tab Return type @tab Standard
-@item @code{DIMAG(Z)} @tab @code{COMPLEX(8) Z} @tab @code{REAL(8)} @tab F95 and later
+@item @code{DIMAG(Z)} @tab @code{COMPLEX(8) Z} @tab @code{REAL(8)} @tab GNU extension
@item @code{IMAG(Z)} @tab @code{COMPLEX(*) Z} @tab @code{REAL(*)} @tab GNU extension
@item @code{IMAGPART(Z)} @tab @code{COMPLEX(*) Z} @tab @code{REAL(*)} @tab GNU extension
@end multitable
diff --git a/gcc/fortran/iresolve.c b/gcc/fortran/iresolve.c
index c72bf9f..1e57881 100644
--- a/gcc/fortran/iresolve.c
+++ b/gcc/fortran/iresolve.c
@@ -877,6 +877,29 @@ gfc_resolve_ior (gfc_expr * f, gfc_expr * i, gfc_expr * j)
void
+gfc_resolve_index_func (gfc_expr * f, gfc_expr * str,
+ ATTRIBUTE_UNUSED gfc_expr * sub_str, gfc_expr * back)
+{
+ gfc_typespec ts;
+
+ f->ts.type = BT_INTEGER;
+ f->ts.kind = gfc_default_integer_kind;
+
+ if (back && back->ts.kind != gfc_default_integer_kind)
+ {
+ ts.type = BT_LOGICAL;
+ ts.kind = gfc_default_integer_kind;
+ ts.derived = NULL;
+ ts.cl = NULL;
+ gfc_convert_type (back, &ts, 2);
+ }
+
+ f->value.function.name =
+ gfc_get_string ("__index_%d_i%d", str->ts.kind, f->ts.kind);
+}
+
+
+void
gfc_resolve_int (gfc_expr * f, gfc_expr * a, gfc_expr * kind)
{
f->ts.type = BT_INTEGER;
@@ -1022,7 +1045,8 @@ gfc_resolve_len (gfc_expr * f, gfc_expr * string)
{
f->ts.type = BT_INTEGER;
f->ts.kind = gfc_default_integer_kind;
- f->value.function.name = gfc_get_string ("__len_%d", string->ts.kind);
+ f->value.function.name = gfc_get_string ("__len_%d_i%d", string->ts.kind,
+ gfc_default_integer_kind);
}
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index b9653eb..3b6d3a7 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -836,6 +836,7 @@ resolve_actual_arglist (gfc_actual_arglist * arg)
|| sym->attr.intrinsic
|| sym->attr.external)
{
+ int actual_ok;
/* If a procedure is not already determined to be something else
check if it is intrinsic. */
@@ -851,6 +852,19 @@ resolve_actual_arglist (gfc_actual_arglist * arg)
"actual argument", sym->name, &e->where);
}
+ actual_ok = gfc_intrinsic_actual_ok (sym->name, sym->attr.subroutine);
+ if (sym->attr.intrinsic && actual_ok == 0)
+ {
+ gfc_error ("Intrinsic '%s' at %L is not allowed as an "
+ "actual argument", sym->name, &e->where);
+ }
+ else if (sym->attr.intrinsic && actual_ok == 2)
+ /* We need a special case for CHAR, which is the only intrinsic
+ function allowed as actual argument in F2003 and not allowed
+ in F95. */
+ gfc_notify_std (GFC_STD_F2003, "Fortran 2003: CHAR intrinsic "
+ "allowed as actual argument at %L", &e->where);
+
if (sym->attr.contained && !sym->attr.use_assoc
&& sym->ns->proc_name->attr.flavor != FL_MODULE)
{
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index f74fcd8..43e27ee 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -1075,9 +1075,14 @@ gfc_get_extern_function_decl (gfc_symbol * sym)
isym->resolve.f1 (&e, &argexpr);
else
{
- /* All specific intrinsics take one or two arguments. */
- gcc_assert (isym->formal->next->next == NULL);
- isym->resolve.f2 (&e, &argexpr, NULL);
+ if (isym->formal->next->next == NULL)
+ isym->resolve.f2 (&e, &argexpr, NULL);
+ else
+ {
+ /* All specific intrinsics take less than 4 arguments. */
+ gcc_assert (isym->formal->next->next->next == NULL);
+ isym->resolve.f3 (&e, &argexpr, NULL, NULL);
+ }
}
if (gfc_option.flag_f2c
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 83be965..4452479 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,14 @@
+2006-10-07 Francois-Xavier Coudert <coudert@clipper.ens.fr>
+
+ PR fortran/16580
+ PR fortran/29288
+ * gcc/testsuite/gfortran.fortran-torture/execute/specifics.f90:
+ Add tests for using all possible intrinsics as actual arguments.
+ * gcc/testsuite/gfortran.dg/specifics_1.f90: Add tests for using
+ all possible intrinsics as actual arguments.
+ * gcc/testsuite/gfortran.dg/specifics_2.f90: New file.
+ * gcc/testsuite/gfortran.dg/specifics_3.f90: New file.
+
2006-10-07 Richard Sandiford <richard@codesourcery.com>
* gcc.dg/debug/debug-1.c: Use -fno-if-conversion MIPS targets.
diff --git a/gcc/testsuite/gfortran.dg/specifics_1.f90 b/gcc/testsuite/gfortran.dg/specifics_1.f90
index c1d8693..a100df4 100644
--- a/gcc/testsuite/gfortran.dg/specifics_1.f90
+++ b/gcc/testsuite/gfortran.dg/specifics_1.f90
@@ -1,9 +1,13 @@
! Program to test intrinsic functions as actual arguments
+!
! Copied from gfortran.fortran-torture/execute/specifics.f90
+! Please keep them in sync
+!
! It is run here with -ff2c option
!
! { dg-do run }
! { dg-options "-ff2c" }
+! Program to test intrinsic functions as actual arguments
subroutine test_c(fn, val, res)
complex fn
complex val, res
@@ -113,13 +117,56 @@ subroutine test_dprod(fn)
if (abs (fn (2.0, 3.0) - 6d0) .gt. 0.00001) call abort
end subroutine
+subroutine test_nint(fn,val,res)
+ integer fn, res
+ real val
+ if (res .ne. fn(val)) call abort
+end subroutine
+
+subroutine test_idnint(fn,val,res)
+ integer fn, res
+ double precision val
+ if (res .ne. fn(val)) call abort
+end subroutine
+
+subroutine test_idim(fn,val1,val2,res)
+ integer fn, res, val1, val2
+ if (res .ne. fn(val1,val2)) call abort
+end subroutine
+
+subroutine test_iabs(fn,val,res)
+ integer fn, res, val
+ if (res .ne. fn(val)) call abort
+end subroutine
+
+subroutine test_len(fn,val,res)
+ integer fn, res
+ character(len=*) val
+ if (res .ne. fn(val)) call abort
+end subroutine
+
+subroutine test_char(fn,val,res)
+ integer val
+ character(len=1) fn, res
+ if (res .ne. fn(val)) call abort
+end subroutine
+
+subroutine test_index(fn,val1,val2,res)
+ integer fn, res
+ character(len=*) val1, val2
+ if (fn(val1,val2) .ne. res) call abort
+end subroutine
+
program specifics
intrinsic abs
intrinsic aint
intrinsic anint
intrinsic acos
+ intrinsic acosh
intrinsic asin
+ intrinsic asinh
intrinsic atan
+ intrinsic atanh
intrinsic cos
intrinsic sin
intrinsic tan
@@ -127,16 +174,21 @@ program specifics
intrinsic sinh
intrinsic tanh
intrinsic alog
+ intrinsic alog10
intrinsic exp
intrinsic sign
+ intrinsic isign
intrinsic amod
intrinsic dabs
intrinsic dint
intrinsic dnint
intrinsic dacos
+ intrinsic dacosh
intrinsic dasin
+ intrinsic dasinh
intrinsic datan
+ intrinsic datanh
intrinsic dcos
intrinsic dsin
intrinsic dtan
@@ -144,6 +196,7 @@ program specifics
intrinsic dsinh
intrinsic dtanh
intrinsic dlog
+ intrinsic dlog10
intrinsic dexp
intrinsic dsign
intrinsic dmod
@@ -161,18 +214,41 @@ program specifics
intrinsic cdlog
intrinsic cdsin
intrinsic cdsqrt
+ intrinsic zcos
+ intrinsic zexp
+ intrinsic zlog
+ intrinsic zsin
+ intrinsic zsqrt
intrinsic cabs
intrinsic cdabs
+ intrinsic zabs
intrinsic dprod
+ intrinsic nint
+ intrinsic idnint
+ intrinsic dim
+ intrinsic ddim
+ intrinsic idim
+ intrinsic iabs
+ intrinsic mod
+ intrinsic len
+ intrinsic index
+ intrinsic char
+
+ intrinsic aimag
+ intrinsic dimag
+
call test_r (abs, -1.0, abs(-1.0))
- call test_r (aint, 1.7, 1.0)
- call test_r (anint, 1.7, 2.0)
+ call test_r (aint, 1.7, aint(1.7))
+ call test_r (anint, 1.7, anint(1.7))
call test_r (acos, 0.5, acos(0.5))
+ call test_r (acosh, 1.5, acosh(1.5))
call test_r (asin, 0.5, asin(0.5))
+ call test_r (asinh, 0.5, asinh(0.5))
call test_r (atan, 0.5, atan(0.5))
+ call test_r (atanh, 0.5, atanh(0.5))
call test_r (cos, 1.0, cos(1.0))
call test_r (sin, 1.0, sin(1.0))
call test_r (tan, 1.0, tan(1.0))
@@ -180,6 +256,7 @@ program specifics
call test_r (sinh, 1.0, sinh(1.0))
call test_r (tanh, 1.0, tanh(1.0))
call test_r (alog, 2.0, alog(2.0))
+ call test_r (alog10, 2.0, alog10(2.0))
call test_r (exp, 1.0, exp(1.0))
call test_r2 (sign, 1.0, -2.0, sign(1.0, -2.0))
call test_r2 (amod, 3.5, 2.0, amod(3.5, 2.0))
@@ -188,8 +265,11 @@ program specifics
call test_d (dint, 1.7d0, 1d0)
call test_d (dnint, 1.7d0, 2d0)
call test_d (dacos, 0.5d0, dacos(0.5d0))
+ call test_d (dacosh, 1.5d0, dacosh(1.5d0))
call test_d (dasin, 0.5d0, dasin(0.5d0))
+ call test_d (dasinh, 0.5d0, dasinh(0.5d0))
call test_d (datan, 0.5d0, datan(0.5d0))
+ call test_d (datanh, 0.5d0, datanh(0.5d0))
call test_d (dcos, 1d0, dcos(1d0))
call test_d (dsin, 1d0, dsin(1d0))
call test_d (dtan, 1d0, dtan(1d0))
@@ -197,6 +277,7 @@ program specifics
call test_d (dsinh, 1d0, dsinh(1d0))
call test_d (dtanh, 1d0, dtanh(1d0))
call test_d (dlog, 2d0, dlog(2d0))
+ call test_d (dlog10, 2d0, dlog10(2d0))
call test_d (dexp, 1d0, dexp(1d0))
call test_d2 (dsign, 1d0, -2d0, sign(1d0, -2d0))
call test_d2 (dmod, 3.5d0, 2d0, dmod(3.5d0, 2d0))
@@ -212,13 +293,34 @@ program specifics
call test_z (dconjg, (1.2d0,-4.d0), dconjg((1.2d0,-4.d0)))
call test_z (cdcos, (1.2d0,-4.d0), cdcos((1.2d0,-4.d0)))
+ call test_z (zcos, (1.2d0,-4.d0), zcos((1.2d0,-4.d0)))
call test_z (cdexp, (1.2d0,-4.d0), cdexp((1.2d0,-4.d0)))
+ call test_z (zexp, (1.2d0,-4.d0), zexp((1.2d0,-4.d0)))
call test_z (cdlog, (1.2d0,-4.d0), cdlog((1.2d0,-4.d0)))
+ call test_z (zlog, (1.2d0,-4.d0), zlog((1.2d0,-4.d0)))
call test_z (cdsin, (1.2d0,-4.d0), cdsin((1.2d0,-4.d0)))
+ call test_z (zsin, (1.2d0,-4.d0), zsin((1.2d0,-4.d0)))
call test_z (cdsqrt, (1.2d0,-4.d0), cdsqrt((1.2d0,-4.d0)))
+ call test_z (zsqrt, (1.2d0,-4.d0), zsqrt((1.2d0,-4.d0)))
call test_cabs (cabs, (1.2,-4.), cabs((1.2,-4.)))
call test_cdabs (cdabs, (1.2d0,-4.d0), cdabs((1.2d0,-4.d0)))
+ call test_cdabs (zabs, (1.2d0,-4.d0), zabs((1.2d0,-4.d0)))
+ call test_cabs (aimag, (1.2,-4.), aimag((1.2,-4.)))
+ call test_cdabs (dimag, (1.2d0,-4.d0), dimag((1.2d0,-4.d0)))
+
+ call test_nint (nint, -1.2, nint(-1.2))
+ call test_idnint (idnint, -1.2d0, idnint(-1.2d0))
+ call test_idim (isign, -42, 17, isign(-42, 17))
+ call test_idim (idim, -42, 17, idim(-42,17))
+ call test_idim (idim, 42, 17, idim(42,17))
+ call test_r2 (dim, 1.2, -4., dim(1.2, -4.))
+ call test_d2 (ddim, 1.2d0, -4.d0, ddim(1.2d0, -4.d0))
+ call test_iabs (iabs, -7, iabs(-7))
+ call test_idim (mod, 5, 2, mod(5,2))
+ call test_len (len, "foobar", len("foobar"))
+ call test_char (char, 47, char(47))
+ call test_index (index, "foobarfoobar", "bar", index("foobarfoobar","bar"))
end program
diff --git a/gcc/testsuite/gfortran.dg/specifics_2.f90 b/gcc/testsuite/gfortran.dg/specifics_2.f90
new file mode 100644
index 0000000..399dbd5
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/specifics_2.f90
@@ -0,0 +1,82 @@
+! { dg-do compile }
+! This is the list of intrinsics allowed as actual arguments
+ intrinsic abs,acos,acosh,aimag,aint,alog,alog10,amod,anint,asin,asinh,atan,&
+ atan2,atanh,cabs,ccos,cexp,char,clog,conjg,cos,cosh,csin,csqrt,dabs,dacos,&
+ dacosh,dasin,dasinh,datan,datan2,datanh,dconjg,dcos,dcosh,ddim,dexp,dim,&
+ dimag,dint,dlog,dlog10,dmod,dnint,dprod,dsign,dsin,dsinh,dsqrt,dtan,dtanh,&
+ exp,iabs,idim,idnint,index,isign,len,mod,nint,sign,sin,sinh,sqrt,tan,&
+ tanh,zabs,zcos,zexp,zlog,zsin,zsqrt
+
+ call foo(abs)
+ call foo(acos)
+ call foo(acosh)
+ call foo(aimag)
+ call foo(aint)
+ call foo(alog)
+ call foo(alog10)
+ call foo(amod)
+ call foo(anint)
+ call foo(asin)
+ call foo(asinh)
+ call foo(atan)
+ call foo(atan2)
+ call foo(atanh)
+ call foo(cabs)
+ call foo(ccos)
+ call foo(cexp)
+ call foo(char)
+ call foo(clog)
+ call foo(conjg)
+ call foo(cos)
+ call foo(cosh)
+ call foo(csin)
+ call foo(csqrt)
+ call foo(dabs)
+ call foo(dacos)
+ call foo(dacosh)
+ call foo(dasin)
+ call foo(dasinh)
+ call foo(datan)
+ call foo(datan2)
+ call foo(datanh)
+ call foo(dconjg)
+ call foo(dcos)
+ call foo(dcosh)
+ call foo(ddim)
+ call foo(dexp)
+ call foo(dim)
+ call foo(dimag)
+ call foo(dint)
+ call foo(dlog)
+ call foo(dlog10)
+ call foo(dmod)
+ call foo(dnint)
+ call foo(dprod)
+ call foo(dsign)
+ call foo(dsin)
+ call foo(dsinh)
+ call foo(dsqrt)
+ call foo(dtan)
+ call foo(dtanh)
+ call foo(exp)
+ call foo(iabs)
+ call foo(idim)
+ call foo(idnint)
+ call foo(index)
+ call foo(isign)
+ call foo(len)
+ call foo(mod)
+ call foo(nint)
+ call foo(sign)
+ call foo(sin)
+ call foo(sinh)
+ call foo(sqrt)
+ call foo(tan)
+ call foo(tanh)
+ call foo(zabs)
+ call foo(zcos)
+ call foo(zexp)
+ call foo(zlog)
+ call foo(zsin)
+ call foo(zsqrt)
+ end
diff --git a/gcc/testsuite/gfortran.dg/specifics_3.f90 b/gcc/testsuite/gfortran.dg/specifics_3.f90
new file mode 100644
index 0000000..3b5ddad
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/specifics_3.f90
@@ -0,0 +1,5 @@
+! { dg-do compile }
+! { dg-options "-std=f95" }
+ intrinsic char
+ call foo(char) ! { dg-error "Fortran 2003: CHAR intrinsic allowed as actual argument" }
+ end
diff --git a/gcc/testsuite/gfortran.fortran-torture/execute/specifics.f90 b/gcc/testsuite/gfortran.fortran-torture/execute/specifics.f90
index 18490ef..ec34aa5 100644
--- a/gcc/testsuite/gfortran.fortran-torture/execute/specifics.f90
+++ b/gcc/testsuite/gfortran.fortran-torture/execute/specifics.f90
@@ -1,4 +1,6 @@
! Program to test intrinsic functions as actual arguments
+!
+! Please keep the content of this file in sync with gfortran.dg/specifics_1.f90
subroutine test_c(fn, val, res)
complex fn
complex val, res
@@ -108,13 +110,56 @@ subroutine test_dprod(fn)
if (abs (fn (2.0, 3.0) - 6d0) .gt. 0.00001) call abort
end subroutine
+subroutine test_nint(fn,val,res)
+ integer fn, res
+ real val
+ if (res .ne. fn(val)) call abort
+end subroutine
+
+subroutine test_idnint(fn,val,res)
+ integer fn, res
+ double precision val
+ if (res .ne. fn(val)) call abort
+end subroutine
+
+subroutine test_idim(fn,val1,val2,res)
+ integer fn, res, val1, val2
+ if (res .ne. fn(val1,val2)) call abort
+end subroutine
+
+subroutine test_iabs(fn,val,res)
+ integer fn, res, val
+ if (res .ne. fn(val)) call abort
+end subroutine
+
+subroutine test_len(fn,val,res)
+ integer fn, res
+ character(len=*) val
+ if (res .ne. fn(val)) call abort
+end subroutine
+
+subroutine test_char(fn,val,res)
+ integer val
+ character(len=1) fn, res
+ if (res .ne. fn(val)) call abort
+end subroutine
+
+subroutine test_index(fn,val1,val2,res)
+ integer fn, res
+ character(len=*) val1, val2
+ if (fn(val1,val2) .ne. res) call abort
+end subroutine
+
program specifics
intrinsic abs
intrinsic aint
intrinsic anint
intrinsic acos
+ intrinsic acosh
intrinsic asin
+ intrinsic asinh
intrinsic atan
+ intrinsic atanh
intrinsic cos
intrinsic sin
intrinsic tan
@@ -122,16 +167,21 @@ program specifics
intrinsic sinh
intrinsic tanh
intrinsic alog
+ intrinsic alog10
intrinsic exp
intrinsic sign
+ intrinsic isign
intrinsic amod
intrinsic dabs
intrinsic dint
intrinsic dnint
intrinsic dacos
+ intrinsic dacosh
intrinsic dasin
+ intrinsic dasinh
intrinsic datan
+ intrinsic datanh
intrinsic dcos
intrinsic dsin
intrinsic dtan
@@ -139,6 +189,7 @@ program specifics
intrinsic dsinh
intrinsic dtanh
intrinsic dlog
+ intrinsic dlog10
intrinsic dexp
intrinsic dsign
intrinsic dmod
@@ -156,18 +207,41 @@ program specifics
intrinsic cdlog
intrinsic cdsin
intrinsic cdsqrt
+ intrinsic zcos
+ intrinsic zexp
+ intrinsic zlog
+ intrinsic zsin
+ intrinsic zsqrt
intrinsic cabs
intrinsic cdabs
+ intrinsic zabs
intrinsic dprod
+ intrinsic nint
+ intrinsic idnint
+ intrinsic dim
+ intrinsic ddim
+ intrinsic idim
+ intrinsic iabs
+ intrinsic mod
+ intrinsic len
+ intrinsic index
+ intrinsic char
+
+ intrinsic aimag
+ intrinsic dimag
+
call test_r (abs, -1.0, abs(-1.0))
- call test_r (aint, 1.7, 1.0)
- call test_r (anint, 1.7, 2.0)
+ call test_r (aint, 1.7, aint(1.7))
+ call test_r (anint, 1.7, anint(1.7))
call test_r (acos, 0.5, acos(0.5))
+ call test_r (acosh, 1.5, acosh(1.5))
call test_r (asin, 0.5, asin(0.5))
+ call test_r (asinh, 0.5, asinh(0.5))
call test_r (atan, 0.5, atan(0.5))
+ call test_r (atanh, 0.5, atanh(0.5))
call test_r (cos, 1.0, cos(1.0))
call test_r (sin, 1.0, sin(1.0))
call test_r (tan, 1.0, tan(1.0))
@@ -175,6 +249,7 @@ program specifics
call test_r (sinh, 1.0, sinh(1.0))
call test_r (tanh, 1.0, tanh(1.0))
call test_r (alog, 2.0, alog(2.0))
+ call test_r (alog10, 2.0, alog10(2.0))
call test_r (exp, 1.0, exp(1.0))
call test_r2 (sign, 1.0, -2.0, sign(1.0, -2.0))
call test_r2 (amod, 3.5, 2.0, amod(3.5, 2.0))
@@ -183,8 +258,11 @@ program specifics
call test_d (dint, 1.7d0, 1d0)
call test_d (dnint, 1.7d0, 2d0)
call test_d (dacos, 0.5d0, dacos(0.5d0))
+ call test_d (dacosh, 1.5d0, dacosh(1.5d0))
call test_d (dasin, 0.5d0, dasin(0.5d0))
+ call test_d (dasinh, 0.5d0, dasinh(0.5d0))
call test_d (datan, 0.5d0, datan(0.5d0))
+ call test_d (datanh, 0.5d0, datanh(0.5d0))
call test_d (dcos, 1d0, dcos(1d0))
call test_d (dsin, 1d0, dsin(1d0))
call test_d (dtan, 1d0, dtan(1d0))
@@ -192,6 +270,7 @@ program specifics
call test_d (dsinh, 1d0, dsinh(1d0))
call test_d (dtanh, 1d0, dtanh(1d0))
call test_d (dlog, 2d0, dlog(2d0))
+ call test_d (dlog10, 2d0, dlog10(2d0))
call test_d (dexp, 1d0, dexp(1d0))
call test_d2 (dsign, 1d0, -2d0, sign(1d0, -2d0))
call test_d2 (dmod, 3.5d0, 2d0, dmod(3.5d0, 2d0))
@@ -207,13 +286,34 @@ program specifics
call test_z (dconjg, (1.2d0,-4.d0), dconjg((1.2d0,-4.d0)))
call test_z (cdcos, (1.2d0,-4.d0), cdcos((1.2d0,-4.d0)))
+ call test_z (zcos, (1.2d0,-4.d0), zcos((1.2d0,-4.d0)))
call test_z (cdexp, (1.2d0,-4.d0), cdexp((1.2d0,-4.d0)))
+ call test_z (zexp, (1.2d0,-4.d0), zexp((1.2d0,-4.d0)))
call test_z (cdlog, (1.2d0,-4.d0), cdlog((1.2d0,-4.d0)))
+ call test_z (zlog, (1.2d0,-4.d0), zlog((1.2d0,-4.d0)))
call test_z (cdsin, (1.2d0,-4.d0), cdsin((1.2d0,-4.d0)))
+ call test_z (zsin, (1.2d0,-4.d0), zsin((1.2d0,-4.d0)))
call test_z (cdsqrt, (1.2d0,-4.d0), cdsqrt((1.2d0,-4.d0)))
+ call test_z (zsqrt, (1.2d0,-4.d0), zsqrt((1.2d0,-4.d0)))
call test_cabs (cabs, (1.2,-4.), cabs((1.2,-4.)))
call test_cdabs (cdabs, (1.2d0,-4.d0), cdabs((1.2d0,-4.d0)))
+ call test_cdabs (zabs, (1.2d0,-4.d0), zabs((1.2d0,-4.d0)))
+ call test_cabs (aimag, (1.2,-4.), aimag((1.2,-4.)))
+ call test_cdabs (dimag, (1.2d0,-4.d0), dimag((1.2d0,-4.d0)))
+
+ call test_nint (nint, -1.2, nint(-1.2))
+ call test_idnint (idnint, -1.2d0, idnint(-1.2d0))
+ call test_idim (isign, -42, 17, isign(-42, 17))
+ call test_idim (idim, -42, 17, idim(-42,17))
+ call test_idim (idim, 42, 17, idim(42,17))
+ call test_r2 (dim, 1.2, -4., dim(1.2, -4.))
+ call test_d2 (ddim, 1.2d0, -4.d0, ddim(1.2d0, -4.d0))
+ call test_iabs (iabs, -7, iabs(-7))
+ call test_idim (mod, 5, 2, mod(5,2))
+ call test_len (len, "foobar", len("foobar"))
+ call test_char (char, 47, char(47))
+ call test_index (index, "foobarfoobar", "bar", index("foobarfoobar","bar"))
end program