diff options
author | Chris Demetriou <cgd@sibyte.com> | 2000-05-18 17:53:04 +0000 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2000-05-18 10:53:04 -0700 |
commit | 7aba5a5ff92706b3db2ef3bfa8df22ea14bc2118 (patch) | |
tree | c3ae46a413ca81be9f5e82070f7c0313b25dbf07 | |
parent | 91542396a697108f57f553951d6ff7c0c03c38d8 (diff) | |
download | gcc-7aba5a5ff92706b3db2ef3bfa8df22ea14bc2118.zip gcc-7aba5a5ff92706b3db2ef3bfa8df22ea14bc2118.tar.gz gcc-7aba5a5ff92706b3db2ef3bfa8df22ea14bc2118.tar.bz2 |
c-common.h (enum c_tree_index): Add g77 type entries.
* c-common.h (enum c_tree_index): Add g77 type entries.
(g77_integer_type_node, g77_uinteger_type_node): New.
(g77_longint_type_node, g77_ulongint_type_node): New.
* c-decl.c (init_decl_processing): Initialize them.
Co-Authored-By: Richard Henderson <rth@cygnus.com>
From-SVN: r33992
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/c-common.h | 13 | ||||
-rw-r--r-- | gcc/c-decl.c | 49 |
3 files changed, 69 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7899410..da4f131 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2000-05-18 Chris Demetriou <cgd@sibyte.com> + Richard Henderson <rth@cygnus.com> + + * c-common.h (enum c_tree_index): Add g77 type entries. + (g77_integer_type_node, g77_uinteger_type_node): New. + (g77_longint_type_node, g77_ulongint_type_node): New. + * c-decl.c (init_decl_processing): Initialize them. + 2000-05-18 Richard Henderson <rth@cygnus.com> * config/h8300/h8300.md (subs patterns): Use %G to negate. diff --git a/gcc/c-common.h b/gcc/c-common.h index 17db8fb..0d25b2a 100644 --- a/gcc/c-common.h +++ b/gcc/c-common.h @@ -45,7 +45,12 @@ enum c_tree_index CTI_VOID_FTYPE_PTR, CTI_INT_FTYPE_INT, CTI_PTR_FTYPE_SIZETYPE, - + + CTI_G77_INTEGER_TYPE, + CTI_G77_UINTEGER_TYPE, + CTI_G77_LONGINT_TYPE, + CTI_G77_ULONGINT_TYPE, + CTI_MAX }; @@ -74,6 +79,12 @@ extern tree c_global_trees[CTI_MAX]; #define int_ftype_int c_global_trees[CTI_INT_FTYPE_INT] #define ptr_ftype_sizetype c_global_trees[CTI_PTR_FTYPE_SIZETYPE] +/* g77 integer types, which which must be kept in sync with f/com.h */ +#define g77_integer_type_node c_global_trees[CTI_G77_INTEGER_TYPE] +#define g77_uinteger_type_node c_global_trees[CTI_G77_UINTEGER_TYPE] +#define g77_longint_type_node c_global_trees[CTI_G77_LONGINT_TYPE] +#define g77_ulongint_type_node c_global_trees[CTI_G77_ULONGINT_TYPE] + /* Pointer to function to generate the VAR_DECL for __FUNCTION__ etc. ID is the identifier to use, NAME is the string. TYPE_DEP indicates whether it depends on type of the function or not diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 040b695..d1393d4 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -3034,6 +3034,55 @@ init_decl_processing () = build_function_type (ptr_type_node, tree_cons (NULL_TREE, ptr_type_node, endlink)); + /* Types which are common to the fortran compiler and libf2c. When + changing these, you also need to be concerned with f/com.h. */ + + if (TYPE_PRECISION (float_type_node) + == TYPE_PRECISION (long_integer_type_node)) + { + g77_integer_type_node = long_integer_type_node; + g77_uinteger_type_node = long_unsigned_type_node; + } + else if (TYPE_PRECISION (float_type_node) + == TYPE_PRECISION (integer_type_node)) + { + g77_integer_type_node = integer_type_node; + g77_uinteger_type_node = unsigned_type_node; + } + else + g77_integer_type_node = g77_uinteger_type_node = NULL_TREE; + + if (g77_integer_type_node != NULL_TREE) + { + pushdecl (build_decl (TYPE_DECL, get_identifier ("__g77_integer"), + g77_integer_type_node)); + pushdecl (build_decl (TYPE_DECL, get_identifier ("__g77_uinteger"), + g77_uinteger_type_node)); + } + + if (TYPE_PRECISION (float_type_node) * 2 + == TYPE_PRECISION (long_integer_type_node)) + { + g77_longint_type_node = long_integer_type_node; + g77_ulongint_type_node = long_unsigned_type_node; + } + else if (TYPE_PRECISION (float_type_node) * 2 + == TYPE_PRECISION (long_long_integer_type_node)) + { + g77_longint_type_node = long_long_integer_type_node; + g77_ulongint_type_node = long_long_unsigned_type_node; + } + else + g77_longint_type_node = g77_ulongint_type_node = NULL_TREE; + + if (g77_longint_type_node != NULL_TREE) + { + pushdecl (build_decl (TYPE_DECL, get_identifier ("__g77_longint"), + g77_longint_type_node)); + pushdecl (build_decl (TYPE_DECL, get_identifier ("__g77_ulongint"), + g77_ulongint_type_node)); + } + builtin_function ("__builtin_aggregate_incoming_address", build_function_type (ptr_type_node, NULL_TREE), BUILT_IN_AGGREGATE_INCOMING_ADDRESS, |