aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/intrinsic.c
diff options
context:
space:
mode:
authorFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>2006-07-26 11:58:48 +0000
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>2006-07-26 11:58:48 +0000
commitbf3fb7e43c8d1f22edda0c427a2ac194e8db104b (patch)
treec7642810eb626a8e434832e2f5f5bee64e4bbc84 /gcc/fortran/intrinsic.c
parent0fb2088c6a08cf849bda7138603045b2f6d8869b (diff)
downloadgcc-bf3fb7e43c8d1f22edda0c427a2ac194e8db104b.zip
gcc-bf3fb7e43c8d1f22edda0c427a2ac194e8db104b.tar.gz
gcc-bf3fb7e43c8d1f22edda0c427a2ac194e8db104b.tar.bz2
intrinsic.c (add_functions): Add INT2, SHORT, INT8, LONG, LSTAT, MCLOCK and MCLOCK8 intrinsic functions.
* intrinsic.c (add_functions): Add INT2, SHORT, INT8, LONG, LSTAT, MCLOCK and MCLOCK8 intrinsic functions. (add_subroutines): Add LSTAT intrinsic subroutine. * gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_INT2, GFC_ISYM_INT8, GFC_ISYM_LONG, GFC_ISYM_LSTAT, GFC_ISYM_MCLOCK and GFC_ISYM_MCLOCK8. * iresolve.c (gfc_resolve_int2, gfc_resolve_int8, gfc_resolve_long, gfc_resolve_lstat, gfc_resolve_mclock, gfc_resolve_mclock8, gfc_resolve_lstat_sub): New functions. * check.c (gfc_check_intconv): New function. * trans-intrinsic.c (gfc_conv_intrinsic_function): Add cases for the added GFC_ISYM_*. * simplify.c (gfc_simplify_intconv, gfc_simplify_int2, gfc_simplify_int8, gfc_simplify_long): New functions. * intrinsic.h (gfc_check_intconv, gfc_simplify_int2, gfc_simplify_int8, gfc_simplify_long, gfc_resolve_int2, gfc_resolve_int8, gfc_resolve_long, gfc_resolve_lstat, gfc_resolve_mclock, gfc_resolve_mclock8, gfc_resolve_lstat_sub): Add prototypes. * gfortran.dg/mclock.f90: New test. * gfortran.dg/int_conv_1.f90: New test. * gfortran.dg/stat_1.f90: New test. * gfortran.dg/stat_2.f90: New test. * configure.ac: Check for function clock. * Makefile.am: Compile new file intrinsics/clock.c. * intrinsics/clock.c: New file. * Makefile.in: Regenerate. * configure: Regenerate. * config.h.in: Regenerate. * intrinsics/stat.c: Rename the old stat_i?_sub functions to helper functions stat_i?_sub_0, and use them for both STAT and LSTAT. From-SVN: r115754
Diffstat (limited to 'gcc/fortran/intrinsic.c')
-rw-r--r--gcc/fortran/intrinsic.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/gcc/fortran/intrinsic.c b/gcc/fortran/intrinsic.c
index 3ee0829..1b8e7cd 100644
--- a/gcc/fortran/intrinsic.c
+++ b/gcc/fortran/intrinsic.c
@@ -1535,6 +1535,26 @@ add_functions (void)
make_generic ("int", GFC_ISYM_INT, GFC_STD_F77);
+ add_sym_1 ("int2", 1, 0, BT_INTEGER, di, GFC_STD_GNU,
+ gfc_check_intconv, gfc_simplify_int2, gfc_resolve_int2,
+ a, BT_REAL, dr, REQUIRED);
+
+ make_alias ("short", GFC_STD_GNU);
+
+ make_generic ("int2", GFC_ISYM_INT2, GFC_STD_GNU);
+
+ add_sym_1 ("int8", 1, 0, BT_INTEGER, di, GFC_STD_GNU,
+ gfc_check_intconv, gfc_simplify_int8, gfc_resolve_int8,
+ a, BT_REAL, dr, REQUIRED);
+
+ make_generic ("int8", GFC_ISYM_INT8, GFC_STD_GNU);
+
+ add_sym_1 ("long", 1, 0, BT_INTEGER, di, GFC_STD_GNU,
+ gfc_check_intconv, gfc_simplify_long, gfc_resolve_long,
+ a, BT_REAL, dr, REQUIRED);
+
+ make_generic ("long", GFC_ISYM_LONG, GFC_STD_GNU);
+
add_sym_2 ("ior", 1, 1, 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);
@@ -1679,6 +1699,12 @@ add_functions (void)
make_generic ("logical", GFC_ISYM_LOGICAL, GFC_STD_F95);
+ add_sym_2 ("lstat", 0, 1, 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,
NULL, gfc_resolve_malloc, a, BT_INTEGER, di, REQUIRED);
@@ -1739,6 +1765,16 @@ add_functions (void)
make_generic ("maxval", GFC_ISYM_MAXVAL, GFC_STD_F95);
+ add_sym_0 ("mclock", 1, 0, BT_INTEGER, di, GFC_STD_GNU,
+ NULL, NULL, gfc_resolve_mclock);
+
+ make_generic ("mclock", GFC_ISYM_MCLOCK, GFC_STD_GNU);
+
+ add_sym_0 ("mclock8", 1, 0, BT_INTEGER, di, GFC_STD_GNU,
+ NULL, NULL, gfc_resolve_mclock8);
+
+ make_generic ("mclock8", GFC_ISYM_MCLOCK8, GFC_STD_GNU);
+
add_sym_3 ("merge", 1, 1, BT_REAL, dr, GFC_STD_F95,
gfc_check_merge, NULL, gfc_resolve_merge,
ts, BT_REAL, dr, REQUIRED, fs, BT_REAL, dr, REQUIRED,
@@ -2410,6 +2446,11 @@ add_subroutines (void)
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,
+ 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,
gfc_check_stat_sub, NULL, gfc_resolve_stat_sub,
name, BT_CHARACTER, dc, REQUIRED, vl, BT_INTEGER, di, REQUIRED,