aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/intrinsic.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/intrinsic.c')
-rw-r--r--gcc/fortran/intrinsic.c78
1 files changed, 77 insertions, 1 deletions
diff --git a/gcc/fortran/intrinsic.c b/gcc/fortran/intrinsic.c
index eedbaa7..7963eec 100644
--- a/gcc/fortran/intrinsic.c
+++ b/gcc/fortran/intrinsic.c
@@ -1152,6 +1152,12 @@ add_functions (void)
make_generic ("cmplx", GFC_ISYM_CMPLX, GFC_STD_F77);
+ add_sym_2 ("complex", 1, 1, 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);
+
+ make_generic ("complex", GFC_ISYM_COMPLEX, GFC_STD_GNU);
+
/* Making dcmplx a specific of cmplx causes cmplx to return a double
complex instead of the default complex. */
@@ -1365,6 +1371,36 @@ add_functions (void)
make_generic ("fstat", GFC_ISYM_FSTAT, GFC_STD_GNU);
+ add_sym_1 ("ftell", 0, 1, 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,
+ 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,
+ 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,
+ 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,
+ 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,
NULL, NULL, gfc_resolve_getcwd,
@@ -1411,6 +1447,12 @@ add_functions (void)
make_generic ("iand", GFC_ISYM_IAND, GFC_STD_F95);
+ add_sym_2 ("and", 1, 0, BT_UNKNOWN, 0, GFC_STD_GNU,
+ gfc_check_and, gfc_simplify_and, gfc_resolve_and,
+ i, BT_UNKNOWN, 0, REQUIRED, j, BT_UNKNOWN, 0, REQUIRED);
+
+ make_generic ("and", GFC_ISYM_AND, GFC_STD_GNU);
+
add_sym_0 ("iargc", 1, 1, BT_INTEGER, di, GFC_STD_GNU,
NULL, NULL, NULL);
@@ -1453,6 +1495,12 @@ add_functions (void)
make_generic ("ieor", GFC_ISYM_IEOR, GFC_STD_F95);
+ add_sym_2 ("xor", 1, 0, BT_UNKNOWN, 0, GFC_STD_GNU,
+ gfc_check_and, gfc_simplify_xor, gfc_resolve_xor,
+ i, BT_UNKNOWN, 0, REQUIRED, j, BT_UNKNOWN, 0, REQUIRED);
+
+ make_generic ("xor", GFC_ISYM_XOR, GFC_STD_GNU);
+
add_sym_0 ("ierrno", 1, 0, BT_INTEGER, di, GFC_STD_GNU,
NULL, NULL, gfc_resolve_ierrno);
@@ -1485,6 +1533,12 @@ add_functions (void)
make_generic ("ior", GFC_ISYM_IOR, GFC_STD_F95);
+ add_sym_2 ("or", 1, 0, BT_UNKNOWN, 0, GFC_STD_GNU,
+ gfc_check_and, gfc_simplify_or, gfc_resolve_or,
+ i, BT_UNKNOWN, 0, REQUIRED, j, BT_UNKNOWN, 0, REQUIRED);
+
+ 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,
gfc_check_irand, NULL, NULL,
@@ -2158,7 +2212,7 @@ add_subroutines (void)
*com = "command", *length = "length", *st = "status",
*val = "value", *num = "number", *name = "name",
*trim_name = "trim_name", *ut = "unit", *han = "handler",
- *sec = "seconds", *res = "result";
+ *sec = "seconds", *res = "result", *of = "offset";
int di, dr, dc, dl, ii;
@@ -2278,13 +2332,35 @@ add_subroutines (void)
make_noreturn();
+ add_sym_3s ("fgetc", 0, 1, 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,
+ 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,
gfc_check_flush, NULL, gfc_resolve_flush,
c, BT_INTEGER, di, OPTIONAL);
+ add_sym_3s ("fputc", 0, 1, 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,
+ 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,
NULL, gfc_resolve_free, c, BT_INTEGER, ii, REQUIRED);
+ add_sym_2s ("ftell", 0, 1, 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,
gfc_check_hostnm_sub, NULL, gfc_resolve_hostnm_sub,
c, BT_CHARACTER, dc, REQUIRED, st, BT_INTEGER, di, OPTIONAL);