This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
finish type kind conversion
- From: Richard Henderson <rth at redhat dot com>
- To: fortran at gcc dot gnu dot org
- Date: Mon, 30 Aug 2004 15:07:39 -0700
- Subject: finish type kind conversion
This is the last of the patch to update the front end to create
all the kinds dynamically based on the target.
There are definitely areas for further cleanup:
(1) gfc_strlen_type_node is always signed, 32-bit. It should be noted
somewhere that this has nothing to do with strlen(3) at all, which
is what I originally thought.
Which is also why I happen to know that things currently break if
this is anything *other* than integer(kind=4). ;-)
(2) All of the places in trans-{array,expr,intrinsic,stmt,io}.c that
speak about fixed type kinds are questionable at best.
Tested i686, alpha, amd64 linux. Committed.
r~
* Make-lang.in (fortran/f95-lang.o): Update dependencies.
(fortran/trans-decl.o, fortran/trans-types.o): Likewise.
* gfortran.h (gfc_integer_info): Add c_char, c_short, c_int,
c_long, c_long_long.
(gfc_logical_info): Add c_bool.
(gfc_real_info): Add mode_precision, c_float, c_double, c_long_double.
* trans-array.c (gfc_array_allocate): Use TYPE_PRECISION
rather than gfc_int[48]_type_node for allocate choice.
* trans-decl.c (gfc_build_intrinsic_function_decls): Cache
local copies of some kind type nodes.
(gfc_build_builtin_function_decls): Likewise.
* trans-expr.c (gfc_conv_power_op): Likewise.
* trans-intrinsic.c (gfc_conv_intrinsic_index,
gfc_conv_intrinsic_scan, gfc_conv_intrinsic_verify,
gfc_conv_intrinsic_trim, gfc_conv_intrinsic_repeat): Likewise.
* trans-stmt.c (gfc_trans_pause, gfc_trans_stop,
gfc_trans_character_select, gfc_trans_allocate): Likewise.
* trans-io.c (gfc_pint4_type_node): Move into ...
(gfc_build_io_library_fndecls): ... here. Cache local copies of
some kind type nodes.
* trans-types.c (gfc_type_nodes): Remove.
(gfc_character1_type_node, gfc_strlen_type_node): New.
(gfc_integer_types, gfc_logical_types): New.
(gfc_real_types, gfc_complex_types): New.
(gfc_init_kinds): Fill in real mode_precision.
(gfc_build_int_type, gfc_build_real_type): New.
(gfc_build_complex_type, gfc_build_logical_type): New.
(c_size_t_size): New.
(gfc_init_types): Loop over kinds.
(gfc_get_int_type, gfc_get_real_type): Use gfc_validate_kind.
(gfc_get_complex_type, gfc_get_logical_type): Likewise.
(gfc_get_character_type_len): Likewise.
(gfc_type_for_size): Loop over kinds; use a reduced set of
unsigned type nodes.
(gfc_type_for_mode): Loop over kinds.
(gfc_signed_or_unsigned_type): Use gfc_type_for_size.
(gfc_unsigned_type, gfc_signed_type): Use gfc_signed_or_unsigned_type.
* trans-types.h (F95_INT1_TYPE, F95_INT2_TYPE, F95_INT4_TYPE,
F95_INT8_TYPE, F95_INT16_TYPE, F95_REAL4_TYPE, F95_REAL8_TYPE,
F95_REAl16_TYPE, F95_COMPLEX4_TYPE, F95_COMPLEX8_TYPE,
F95_COMPLEX16_TYPE, F95_LOGICAL1_TYPE, F95_LOGICAL2_TYPE,
F95_LOGICAL4_TYPE, F95_LOGICAL8_TYPE, F95_LOGICAL16_TYPE,
F95_CHARACTER1_TYPE, NUM_F95_TYPES, gfc_type_nodes,
gfc_int1_type_node, gfc_int2_type_node, gfc_int4_type_node,
gfc_int8_type_node, gfc_int16_type_node, gfc_real4_type_node,
gfc_real8_type_node, gfc_real16_type_node, gfc_complex4_type_node,
gfc_complex8_type_node, gfc_complex16_type_node,
gfc_logical1_type_node, gfc_logical2_type_node,
gfc_logical4_type_node, gfc_logical8_type_node,
gfc_logical16_type_node, gfc_strlen_kind): Remove.
(gfc_character1_type_node): Turn in to a variable.
(gfc_strlen_type_node): Likewise.
Index: Make-lang.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/Make-lang.in,v
retrieving revision 1.8
diff -c -p -d -r1.8 Make-lang.in
*** Make-lang.in 4 Jul 2004 09:01:40 -0000 1.8
--- Make-lang.in 30 Aug 2004 21:45:34 -0000
*************** $(F95_PARSER_OBJS): fortran/gfortran.h f
*** 278,291 ****
GFORTRAN_TRANS_DEPS = fortran/gfortran.h fortran/intrinsic.h fortran/trans-array.h \
fortran/trans-const.h fortran/trans-const.h fortran/trans.h \
fortran/trans-stmt.h fortran/trans-types.h \
! $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(TM_H) coretypes.h
fortran/f95-lang.o: $(GFORTRAN_TRANS_DEPS) fortran/mathbuiltins.def \
! gt-fortran-f95-lang.h gtype-fortran.h cgraph.h
fortran/convert.o: $(GFORTRAN_TRANS_DEPS)
fortran/trans.o: $(GFORTRAN_TRANS_DEPS)
! fortran/trans-decl.o: $(GFORTRAN_TRANS_DEPS) gt-fortran-trans-decl.h cgraph.h
! fortran/trans-types.o: $(GFORTRAN_TRANS_DEPS) gt-fortran-trans-types.h
fortran/trans-const.o: $(GFORTRAN_TRANS_DEPS)
fortran/trans-expr.o: $(GFORTRAN_TRANS_DEPS)
fortran/trans-stmt.o: $(GFORTRAN_TRANS_DEPS)
--- 278,294 ----
GFORTRAN_TRANS_DEPS = fortran/gfortran.h fortran/intrinsic.h fortran/trans-array.h \
fortran/trans-const.h fortran/trans-const.h fortran/trans.h \
fortran/trans-stmt.h fortran/trans-types.h \
! $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(TM_H) coretypes.h $(GGC_H)
fortran/f95-lang.o: $(GFORTRAN_TRANS_DEPS) fortran/mathbuiltins.def \
! gt-fortran-f95-lang.h gtype-fortran.h cgraph.h $(TARGET_H)
fortran/convert.o: $(GFORTRAN_TRANS_DEPS)
fortran/trans.o: $(GFORTRAN_TRANS_DEPS)
! fortran/trans-decl.o: $(GFORTRAN_TRANS_DEPS) gt-fortran-trans-decl.h \
! cgraph.h $(TARGET_H) function.h errors.h $(FLAGS_H) tree-gimple.h \
! tree-dump.h
! fortran/trans-types.o: $(GFORTRAN_TRANS_DEPS) gt-fortran-trans-types.h \
! real.h toplev.h $(TARGET_H)
fortran/trans-const.o: $(GFORTRAN_TRANS_DEPS)
fortran/trans-expr.o: $(GFORTRAN_TRANS_DEPS)
fortran/trans-stmt.o: $(GFORTRAN_TRANS_DEPS)
Index: gfortran.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/gfortran.h,v
retrieving revision 1.33
diff -c -p -d -r1.33 gfortran.h
*** gfortran.h 30 Aug 2004 19:08:38 -0000 1.33
--- gfortran.h 30 Aug 2004 21:45:34 -0000
*************** gfc_expr;
*** 1090,1101 ****
typedef struct
{
! int kind, radix, digits, bit_size;
! int range;
! mpz_t huge;
! mpz_t min_int, max_int; /* Values really representable by the target */
}
gfc_integer_info;
--- 1090,1107 ----
typedef struct
{
! /* Values really representable by the target. */
! mpz_t huge, min_int, max_int;
! int kind, radix, digits, bit_size, range;
! /* True if the C type of the given name maps to this precision.
! Note that more than one bit can be set. */
! unsigned int c_char : 1;
! unsigned int c_short : 1;
! unsigned int c_int : 1;
! unsigned int c_long : 1;
! unsigned int c_long_long : 1;
}
gfc_integer_info;
*************** typedef struct
*** 1106,1111 ****
--- 1112,1119 ----
{
int kind, bit_size;
+ /* True if the C++ type bool, C99 type _Bool, maps to this precision. */
+ unsigned int c_bool : 1;
}
gfc_logical_info;
*************** extern gfc_logical_info gfc_logical_kind
*** 1114,1123 ****
typedef struct
{
int kind, radix, digits, min_exponent, max_exponent;
-
int range, precision;
! mpfr_t epsilon, huge, tiny;
}
gfc_real_info;
--- 1122,1139 ----
typedef struct
{
+ mpfr_t epsilon, huge, tiny;
int kind, radix, digits, min_exponent, max_exponent;
int range, precision;
!
! /* The precision of the type as reported by GET_MODE_PRECISION. */
! int mode_precision;
!
! /* True if the C type of the given name maps to this precision.
! Note that more than one bit can be set. */
! unsigned int c_float : 1;
! unsigned int c_double : 1;
! unsigned int c_long_double : 1;
}
gfc_real_info;
Index: trans-array.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/trans-array.c,v
retrieving revision 1.22
diff -c -p -d -r1.22 trans-array.c
*** trans-array.c 25 Aug 2004 16:50:06 -0000 1.22
--- trans-array.c 30 Aug 2004 21:45:34 -0000
*************** gfc_array_allocate (gfc_se * se, gfc_ref
*** 2784,2792 ****
pointer = gfc_build_addr_expr (NULL, tmp);
pointer = gfc_evaluate_now (pointer, &se->pre);
! if (gfc_array_index_type == gfc_int4_type_node)
allocate = gfor_fndecl_allocate;
! else if (gfc_array_index_type == gfc_int8_type_node)
allocate = gfor_fndecl_allocate64;
else
abort ();
--- 2784,2792 ----
pointer = gfc_build_addr_expr (NULL, tmp);
pointer = gfc_evaluate_now (pointer, &se->pre);
! if (TYPE_PRECISION (gfc_array_index_type) == 32)
allocate = gfor_fndecl_allocate;
! else if (TYPE_PRECISION (gfc_array_index_type) == 64)
allocate = gfor_fndecl_allocate64;
else
abort ();
Index: trans-decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/trans-decl.c,v
retrieving revision 1.38
diff -c -p -d -r1.38 trans-decl.c
*** trans-decl.c 30 Aug 2004 19:08:38 -0000 1.38
--- trans-decl.c 30 Aug 2004 21:45:34 -0000
*************** gfc_build_library_function_decl (tree na
*** 1559,1564 ****
--- 1559,1572 ----
static void
gfc_build_intrinsic_function_decls (void)
{
+ tree gfc_int4_type_node = gfc_get_int_type (4);
+ tree gfc_int8_type_node = gfc_get_int_type (8);
+ tree gfc_logical4_type_node = gfc_get_logical_type (4);
+ tree gfc_real4_type_node = gfc_get_real_type (4);
+ tree gfc_real8_type_node = gfc_get_real_type (8);
+ tree gfc_complex4_type_node = gfc_get_complex_type (4);
+ tree gfc_complex8_type_node = gfc_get_complex_type (8);
+
/* String functions. */
gfor_fndecl_copy_string =
gfc_build_library_function_decl (get_identifier (PREFIX("copy_string")),
*************** gfc_build_intrinsic_function_decls (void
*** 1738,1743 ****
--- 1746,1755 ----
void
gfc_build_builtin_function_decls (void)
{
+ tree gfc_int4_type_node = gfc_get_int_type (4);
+ tree gfc_int8_type_node = gfc_get_int_type (8);
+ tree gfc_logical4_type_node = gfc_get_logical_type (4);
+
gfor_fndecl_internal_malloc =
gfc_build_library_function_decl (get_identifier (PREFIX("internal_malloc")),
pvoid_type_node, 1, gfc_int4_type_node);
Index: trans-expr.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/trans-expr.c,v
retrieving revision 1.22
diff -c -p -d -r1.22 trans-expr.c
*** trans-expr.c 25 Aug 2004 22:07:19 -0000 1.22
--- trans-expr.c 30 Aug 2004 21:45:34 -0000
*************** gfc_conv_cst_int_power (gfc_se * se, tre
*** 553,558 ****
--- 553,559 ----
static void
gfc_conv_power_op (gfc_se * se, gfc_expr * expr)
{
+ tree gfc_int4_type_node;
int kind;
int ikind;
gfc_se lse;
*************** gfc_conv_power_op (gfc_se * se, gfc_expr
*** 573,578 ****
--- 574,581 ----
if (gfc_conv_cst_int_power (se, lse.expr, rse.expr))
return;
+ gfc_int4_type_node = gfc_get_int_type (4);
+
kind = expr->op1->ts.kind;
switch (expr->op2->ts.type)
{
Index: trans-intrinsic.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/trans-intrinsic.c,v
retrieving revision 1.19
diff -c -p -d -r1.19 trans-intrinsic.c
*** trans-intrinsic.c 29 Aug 2004 15:58:13 -0000 1.19
--- trans-intrinsic.c 30 Aug 2004 21:45:35 -0000
*************** gfc_conv_intrinsic_len_trim (gfc_se * se
*** 1945,1950 ****
--- 1945,1951 ----
static void
gfc_conv_intrinsic_index (gfc_se * se, gfc_expr * expr)
{
+ tree gfc_logical4_type_node = gfc_get_logical_type (4);
tree args;
tree back;
tree type;
*************** gfc_conv_associated (gfc_se *se, gfc_exp
*** 2245,2250 ****
--- 2246,2252 ----
static void
gfc_conv_intrinsic_scan (gfc_se * se, gfc_expr * expr)
{
+ tree gfc_logical4_type_node = gfc_get_logical_type (4);
tree args;
tree back;
tree type;
*************** gfc_conv_intrinsic_scan (gfc_se * se, gf
*** 2277,2282 ****
--- 2279,2285 ----
static void
gfc_conv_intrinsic_verify (gfc_se * se, gfc_expr * expr)
{
+ tree gfc_logical4_type_node = gfc_get_logical_type (4);
tree args;
tree back;
tree type;
*************** gfc_conv_intrinsic_sr_kind (gfc_se * se,
*** 2529,2534 ****
--- 2532,2538 ----
static void
gfc_conv_intrinsic_trim (gfc_se * se, gfc_expr * expr)
{
+ tree gfc_int4_type_node = gfc_get_int_type (4);
tree var;
tree len;
tree addr;
*************** gfc_conv_intrinsic_trim (gfc_se * se, gf
*** 2570,2575 ****
--- 2574,2580 ----
static void
gfc_conv_intrinsic_repeat (gfc_se * se, gfc_expr * expr)
{
+ tree gfc_int4_type_node = gfc_get_int_type (4);
tree tmp;
tree len;
tree args;
Index: trans-io.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/trans-io.c,v
retrieving revision 1.14
diff -c -p -d -r1.14 trans-io.c
*** trans-io.c 27 Aug 2004 14:49:35 -0000 1.14
--- trans-io.c 30 Aug 2004 21:45:35 -0000
*************** Software Foundation, 59 Temple Place - S
*** 39,46 ****
#include "trans-const.h"
- static GTY(()) tree gfc_pint4_type_node;
-
/* Members of the ioparm structure. */
static GTY(()) tree ioparm_unit;
--- 39,44 ----
*************** static enum { READ, WRITE, IOLENGTH } la
*** 160,172 ****
void
gfc_build_io_library_fndecls (void)
{
tree ioparm_type;
gfc_pint4_type_node = build_pointer_type (gfc_int4_type_node);
! /* Build the st_parameter structure. Information associated with I/O
! calls are transferred here. This must match the one defined in the
! library exactly. */
ioparm_type = make_node (RECORD_TYPE);
TYPE_NAME (ioparm_type) = get_identifier ("_gfc_ioparm");
--- 158,173 ----
void
gfc_build_io_library_fndecls (void)
{
+ tree gfc_int4_type_node;
+ tree gfc_pint4_type_node;
tree ioparm_type;
+ gfc_int4_type_node = gfc_get_int_type (4);
gfc_pint4_type_node = build_pointer_type (gfc_int4_type_node);
! /* Build the st_parameter structure. Information associated with I/O
! calls are transferred here. This must match the one defined in the
! library exactly. */
ioparm_type = make_node (RECORD_TYPE);
TYPE_NAME (ioparm_type) = get_identifier ("_gfc_ioparm");
Index: trans-stmt.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/trans-stmt.c,v
retrieving revision 1.10
diff -c -p -d -r1.10 trans-stmt.c
*** trans-stmt.c 25 Aug 2004 15:50:35 -0000 1.10
--- trans-stmt.c 30 Aug 2004 21:45:35 -0000
*************** gfc_trans_return (gfc_code * code ATTRIB
*** 275,280 ****
--- 275,281 ----
tree
gfc_trans_pause (gfc_code * code)
{
+ tree gfc_int4_type_node = gfc_get_int_type (4);
gfc_se se;
tree args;
tree tmp;
*************** gfc_trans_pause (gfc_code * code)
*** 314,319 ****
--- 315,321 ----
tree
gfc_trans_stop (gfc_code * code)
{
+ tree gfc_int4_type_node = gfc_get_int_type (4);
gfc_se se;
tree args;
tree tmp;
*************** gfc_trans_character_select (gfc_code *co
*** 991,996 ****
--- 993,1000 ----
if (select_struct == NULL)
{
+ tree gfc_int4_type_node = gfc_get_int_type (4);
+
select_struct = make_node (RECORD_TYPE);
TYPE_NAME (select_struct) = get_identifier ("_jump_struct");
*************** gfc_trans_allocate (gfc_code * code)
*** 3016,3021 ****
--- 3020,3027 ----
if (code->expr)
{
+ tree gfc_int4_type_node = gfc_get_int_type (4);
+
stat = gfc_create_var (gfc_int4_type_node, "stat");
pstat = gfc_build_addr_expr (NULL, stat);
Index: trans-types.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/trans-types.c,v
retrieving revision 1.21
diff -c -p -d -r1.21 trans-types.c
*** trans-types.c 30 Aug 2004 04:47:49 -0000 1.21
--- trans-types.c 30 Aug 2004 21:45:35 -0000
*************** Software Foundation, 59 Temple Place - S
*** 50,64 ****
static tree gfc_get_derived_type (gfc_symbol * derived);
- tree gfc_type_nodes[NUM_F95_TYPES];
-
tree gfc_array_index_type;
tree pvoid_type_node;
tree ppvoid_type_node;
tree pchar_type_node;
! static GTY(()) tree gfc_desc_dim_type = NULL;
!
static GTY(()) tree gfc_max_array_element_size;
/* Arrays for all integral and real kinds. We'll fill this in at runtime
--- 50,63 ----
static tree gfc_get_derived_type (gfc_symbol * derived);
tree gfc_array_index_type;
tree pvoid_type_node;
tree ppvoid_type_node;
tree pchar_type_node;
+ tree gfc_character1_type_node;
+ tree gfc_strlen_type_node;
! static GTY(()) tree gfc_desc_dim_type;
static GTY(()) tree gfc_max_array_element_size;
/* Arrays for all integral and real kinds. We'll fill this in at runtime
*************** static GTY(()) tree gfc_max_array_elemen
*** 67,75 ****
--- 66,78 ----
#define MAX_INT_KINDS 5
gfc_integer_info gfc_integer_kinds[MAX_INT_KINDS + 1];
gfc_logical_info gfc_logical_kinds[MAX_INT_KINDS + 1];
+ static GTY(()) tree gfc_integer_types[MAX_INT_KINDS + 1];
+ static GTY(()) tree gfc_logical_types[MAX_INT_KINDS + 1];
#define MAX_REAL_KINDS 4
gfc_real_info gfc_real_kinds[MAX_REAL_KINDS + 1];
+ static GTY(()) tree gfc_real_types[MAX_REAL_KINDS + 1];
+ static GTY(()) tree gfc_complex_types[MAX_REAL_KINDS + 1];
/* The integer kind to use for array indices. This will be set to the
proper value based on target information from the backend. */
*************** gfc_init_kinds (void)
*** 178,183 ****
--- 181,187 ----
gfc_real_kinds[r_index].digits = fmt->p;
gfc_real_kinds[r_index].min_exponent = fmt->emin;
gfc_real_kinds[r_index].max_exponent = fmt->emax;
+ gfc_real_kinds[r_index].mode_precision = GET_MODE_PRECISION (mode);
r_index += 1;
}
*************** gfc_validate_kind (bt type, int kind, bo
*** 324,329 ****
--- 328,454 ----
}
+ /* Four subroutines of gfc_init_types. Create type nodes for the given kind.
+ Reuse common type nodes where possible. Recognize if the kind matches up
+ with a C type. This will be used later in determining which routines may
+ be scarfed from libm. */
+
+ static tree
+ gfc_build_int_type (gfc_integer_info *info)
+ {
+ int mode_precision = info->bit_size;
+
+ if (mode_precision == CHAR_TYPE_SIZE)
+ info->c_char = 1;
+ if (mode_precision == SHORT_TYPE_SIZE)
+ info->c_short = 1;
+ if (mode_precision == INT_TYPE_SIZE)
+ info->c_int = 1;
+ if (mode_precision == LONG_TYPE_SIZE)
+ info->c_long = 1;
+ if (mode_precision == LONG_LONG_TYPE_SIZE)
+ info->c_long_long = 1;
+
+ if (TYPE_PRECISION (intQI_type_node) == mode_precision)
+ return intQI_type_node;
+ if (TYPE_PRECISION (intHI_type_node) == mode_precision)
+ return intHI_type_node;
+ if (TYPE_PRECISION (intSI_type_node) == mode_precision)
+ return intSI_type_node;
+ if (TYPE_PRECISION (intDI_type_node) == mode_precision)
+ return intDI_type_node;
+ if (TYPE_PRECISION (intTI_type_node) == mode_precision)
+ return intTI_type_node;
+
+ return make_signed_type (mode_precision);
+ }
+
+ static tree
+ gfc_build_real_type (gfc_real_info *info)
+ {
+ int mode_precision = info->mode_precision;
+ tree new_type;
+
+ if (mode_precision == FLOAT_TYPE_SIZE)
+ info->c_float = 1;
+ if (mode_precision == DOUBLE_TYPE_SIZE)
+ info->c_double = 1;
+ if (mode_precision == LONG_DOUBLE_TYPE_SIZE)
+ info->c_long_double = 1;
+
+ if (TYPE_PRECISION (float_type_node) == mode_precision)
+ return float_type_node;
+ if (TYPE_PRECISION (double_type_node) == mode_precision)
+ return double_type_node;
+ if (TYPE_PRECISION (long_double_type_node) == mode_precision)
+ return long_double_type_node;
+
+ new_type = make_node (REAL_TYPE);
+ TYPE_PRECISION (new_type) = mode_precision;
+ layout_type (new_type);
+ return new_type;
+ }
+
+ static tree
+ gfc_build_complex_type (tree scalar_type)
+ {
+ tree new_type;
+
+ if (scalar_type == NULL)
+ return NULL;
+ if (scalar_type == float_type_node)
+ return complex_float_type_node;
+ if (scalar_type == double_type_node)
+ return complex_double_type_node;
+ if (scalar_type == long_double_type_node)
+ return complex_long_double_type_node;
+
+ new_type = make_node (COMPLEX_TYPE);
+ TREE_TYPE (new_type) = scalar_type;
+ layout_type (new_type);
+ return new_type;
+ }
+
+ static tree
+ gfc_build_logical_type (gfc_logical_info *info)
+ {
+ int bit_size = info->bit_size;
+ tree new_type;
+
+ if (bit_size == BOOL_TYPE_SIZE)
+ {
+ info->c_bool = 1;
+ return boolean_type_node;
+ }
+
+ new_type = make_unsigned_type (bit_size);
+ TREE_SET_CODE (new_type, BOOLEAN_TYPE);
+ TYPE_MAX_VALUE (new_type) = build_int_cst (new_type, 1);
+ TYPE_PRECISION (new_type) = 1;
+
+ return new_type;
+ }
+
+ #if 0
+ /* Return the bit size of the C "size_t". */
+
+ static unsigned int
+ c_size_t_size (void)
+ {
+ #ifdef SIZE_TYPE
+ if (strcmp (SIZE_TYPE, "unsigned int") == 0)
+ return INT_TYPE_SIZE;
+ if (strcmp (SIZE_TYPE, "long unsigned int") == 0)
+ return LONG_TYPE_SIZE;
+ if (strcmp (SIZE_TYPE, "short unsigned int") == 0)
+ return SHORT_TYPE_SIZE;
+ abort ();
+ #else
+ return LONG_TYPE_SIZE;
+ #endif
+ }
+ #endif
+
/* Create the backend type nodes. We map them to their
equivalent C type, at least for now. We also give
names to the types here, and we push them in the
*************** gfc_validate_kind (bt type, int kind, bo
*** 332,400 ****
void
gfc_init_types (void)
{
unsigned n;
unsigned HOST_WIDE_INT hi;
unsigned HOST_WIDE_INT lo;
! /* Name the types. */
#define PUSH_TYPE(name, node) \
pushdecl (build_decl (TYPE_DECL, get_identifier (name), node))
! gfc_int1_type_node = signed_char_type_node;
! PUSH_TYPE ("int1", gfc_int1_type_node);
! gfc_int2_type_node = short_integer_type_node;
! PUSH_TYPE ("int2", gfc_int2_type_node);
! gfc_int4_type_node = gfc_type_for_size (32, 0 /*unsigned */ );
! PUSH_TYPE ("int4", gfc_int4_type_node);
! gfc_int8_type_node = gfc_type_for_size (64, 0 /*unsigned */ );
! PUSH_TYPE ("int8", gfc_int8_type_node);
! #if (GFC_USE_TYPES16 && (HOST_BITS_PER_WIDE_INT >= 64))
! gfc_int16_type_node = gfc_type_for_size (128, 0 /*unsigned */ );
! PUSH_TYPE ("int16", gfc_int16_type_node);
! #endif
! gfc_real4_type_node = float_type_node;
! PUSH_TYPE ("real4", gfc_real4_type_node);
! gfc_real8_type_node = double_type_node;
! PUSH_TYPE ("real8", gfc_real8_type_node);
! #if (GFC_USE_TYPES16 && (HOST_BITS_PER_WIDE_INT >= 64))
! /* Hmm, this will not work. Ref. g77 */
! gfc_real16_type_node = long_double_type_node;
! PUSH_TYPE ("real16", gfc_real16_type_node);
! #endif
! gfc_complex4_type_node = complex_float_type_node;
! PUSH_TYPE ("complex4", gfc_complex4_type_node);
! gfc_complex8_type_node = complex_double_type_node;
! PUSH_TYPE ("complex8", gfc_complex8_type_node);
! #if (GFC_USE_TYPES16 && (HOST_BITS_PER_WIDE_INT >= 64))
! /* Hmm, this will not work. Ref. g77 */
! gfc_complex16_type_node = complex_long_double_type_node;
! PUSH_TYPE ("complex16", gfc_complex16_type_node);
! #endif
! gfc_logical1_type_node = make_node (BOOLEAN_TYPE);
! TYPE_PRECISION (gfc_logical1_type_node) = 8;
! fixup_unsigned_type (gfc_logical1_type_node);
! PUSH_TYPE ("logical1", gfc_logical1_type_node);
! gfc_logical2_type_node = make_node (BOOLEAN_TYPE);
! TYPE_PRECISION (gfc_logical2_type_node) = 16;
! fixup_unsigned_type (gfc_logical2_type_node);
! PUSH_TYPE ("logical2", gfc_logical2_type_node);
! gfc_logical4_type_node = make_node (BOOLEAN_TYPE);
! TYPE_PRECISION (gfc_logical4_type_node) = 32;
! fixup_unsigned_type (gfc_logical4_type_node);
! PUSH_TYPE ("logical4", gfc_logical4_type_node);
! gfc_logical8_type_node = make_node (BOOLEAN_TYPE);
! TYPE_PRECISION (gfc_logical8_type_node) = 64;
! fixup_unsigned_type (gfc_logical8_type_node);
! PUSH_TYPE ("logical8", gfc_logical8_type_node);
! #if (GFC_USE_TYPES16 && (HOST_BITS_PER_WIDE_INT >= 64))
! gfc_logical16_type_node = make_node (BOOLEAN_TYPE);
! TYPE_PRECISION (gfc_logical16_type_node) = 128;
! fixup_unsigned_type (gfc_logical16_type_node);
! PUSH_TYPE ("logical16", gfc_logical16_type_node);
! #endif
gfc_character1_type_node = build_type_variant (signed_char_type_node, 0, 0);
PUSH_TYPE ("char", gfc_character1_type_node);
--- 457,505 ----
void
gfc_init_types (void)
{
+ char name_buf[16];
+ int index;
+ tree type;
unsigned n;
unsigned HOST_WIDE_INT hi;
unsigned HOST_WIDE_INT lo;
! /* Create and name the types. */
#define PUSH_TYPE(name, node) \
pushdecl (build_decl (TYPE_DECL, get_identifier (name), node))
! for (index = 0; gfc_integer_kinds[index].kind != 0; ++index)
! {
! type = gfc_build_int_type (&gfc_integer_kinds[index]);
! gfc_integer_types[index] = type;
! snprintf (name_buf, sizeof(name_buf), "int%d",
! gfc_integer_kinds[index].kind);
! PUSH_TYPE (name_buf, type);
! }
! for (index = 0; gfc_logical_kinds[index].kind != 0; ++index)
! {
! type = gfc_build_logical_type (&gfc_logical_kinds[index]);
! gfc_logical_types[index] = type;
! snprintf (name_buf, sizeof(name_buf), "logical%d",
! gfc_logical_kinds[index].kind);
! PUSH_TYPE (name_buf, type);
! }
! for (index = 0; gfc_real_kinds[index].kind != 0; index++)
! {
! type = gfc_build_real_type (&gfc_real_kinds[index]);
! gfc_real_types[index] = type;
! snprintf (name_buf, sizeof(name_buf), "real%d",
! gfc_real_kinds[index].kind);
! PUSH_TYPE (name_buf, type);
! type = gfc_build_complex_type (type);
! gfc_complex_types[index] = type;
! snprintf (name_buf, sizeof(name_buf), "complex%d",
! gfc_real_kinds[index].kind);
! PUSH_TYPE (name_buf, type);
! }
gfc_character1_type_node = build_type_variant (signed_char_type_node, 0, 0);
PUSH_TYPE ("char", gfc_character1_type_node);
*************** gfc_init_types (void)
*** 407,412 ****
--- 512,518 ----
PUSH_TYPE ("c_integer", integer_type_node);
if (!TYPE_NAME (char_type_node))
PUSH_TYPE ("c_char", char_type_node);
+
#undef PUSH_TYPE
pvoid_type_node = build_pointer_type (void_type_node);
*************** gfc_init_types (void)
*** 419,534 ****
by the number of bits available to store this field in the array
descriptor. */
! n = TREE_INT_CST_LOW (TYPE_SIZE (gfc_array_index_type))
! - GFC_DTYPE_SIZE_SHIFT;
!
! if (n > sizeof (HOST_WIDE_INT) * 8)
! {
! lo = ~(unsigned HOST_WIDE_INT) 0;
! hi = lo >> (sizeof (HOST_WIDE_INT) * 16 - n);
! }
else
! {
! hi = 0;
! lo = (~(unsigned HOST_WIDE_INT) 0) >> (sizeof (HOST_WIDE_INT) * 8 - n);
! }
gfc_max_array_element_size
= build_int_cst_wide (long_unsigned_type_node, lo, hi);
size_type_node = gfc_array_index_type;
- boolean_type_node = gfc_get_logical_type (gfc_default_logical_kind);
boolean_true_node = build_int_cst (boolean_type_node, 1);
boolean_false_node = build_int_cst (boolean_type_node, 0);
}
! /* Get a type node for an integer kind. */
tree
gfc_get_int_type (int kind)
{
! switch (kind)
! {
! case 1:
! return (gfc_int1_type_node);
! case 2:
! return (gfc_int2_type_node);
! case 4:
! return (gfc_int4_type_node);
! case 8:
! return (gfc_int8_type_node);
! #if (GFC_USE_TYPES16 && (HOST_BITS_PER_WIDE_INT >= 64))
! case 16:
! return (95 _int16_type_node);
! #endif
! default:
! fatal_error ("integer kind=%d not available", kind);
! }
}
- /* Get a type node for a real kind. */
-
tree
gfc_get_real_type (int kind)
{
! switch (kind)
! {
! case 4:
! return (gfc_real4_type_node);
! case 8:
! return (gfc_real8_type_node);
! #if (GFC_USE_TYPES16 && (HOST_BITS_PER_WIDE_INT >= 64))
! case 16:
! return (gfc_real16_type_node);
! #endif
! default:
! fatal_error ("real kind=%d not available", kind);
! }
}
- /* Get a type node for a complex kind. */
-
tree
gfc_get_complex_type (int kind)
{
!
! switch (kind)
! {
! case 4:
! return (gfc_complex4_type_node);
! case 8:
! return (gfc_complex8_type_node);
! #if (GFC_USE_TYPES16 && (HOST_BITS_PER_WIDE_INT >= 64))
! case 16:
! return (gfc_complex16_type_node);
! #endif
! default:
! fatal_error ("complex kind=%d not available", kind);
! }
}
- /* Get a type node for a logical kind. */
-
tree
gfc_get_logical_type (int kind)
{
! switch (kind)
! {
! case 1:
! return (gfc_logical1_type_node);
! case 2:
! return (gfc_logical2_type_node);
! case 4:
! return (gfc_logical4_type_node);
! case 8:
! return (gfc_logical8_type_node);
! #if (GFC_USE_TYPES16 && (HOST_BITS_PER_WIDE_INT >= 64))
! case 16:
! return (gfc_logical16_type_node);
! #endif
! default:
! fatal_error ("logical kind=%d not available", kind);
! }
}
/* Create a character type with the given kind and length. */
--- 525,577 ----
by the number of bits available to store this field in the array
descriptor. */
! n = TYPE_PRECISION (gfc_array_index_type) - GFC_DTYPE_SIZE_SHIFT;
! lo = ~ (unsigned HOST_WIDE_INT) 0;
! if (n > HOST_BITS_PER_WIDE_INT)
! hi = lo >> (2*HOST_BITS_PER_WIDE_INT - n);
else
! hi = 0, lo >>= HOST_BITS_PER_WIDE_INT - n;
gfc_max_array_element_size
= build_int_cst_wide (long_unsigned_type_node, lo, hi);
size_type_node = gfc_array_index_type;
+ boolean_type_node = gfc_get_logical_type (gfc_default_logical_kind);
boolean_true_node = build_int_cst (boolean_type_node, 1);
boolean_false_node = build_int_cst (boolean_type_node, 0);
+
+ /* ??? Shouldn't this be based on gfc_index_integer_kind or so? */
+ gfc_strlen_type_node = gfc_get_int_type (4);
}
! /* Get the type node for the given type and kind. */
tree
gfc_get_int_type (int kind)
{
! int index = gfc_validate_kind (BT_INTEGER, kind, false);
! return gfc_integer_types[index];
}
tree
gfc_get_real_type (int kind)
{
! int index = gfc_validate_kind (BT_REAL, kind, false);
! return gfc_real_types[index];
}
tree
gfc_get_complex_type (int kind)
{
! int index = gfc_validate_kind (BT_COMPLEX, kind, false);
! return gfc_complex_types[index];
}
tree
gfc_get_logical_type (int kind)
{
! int index = gfc_validate_kind (BT_LOGICAL, kind, false);
! return gfc_logical_types[index];
}
/* Create a character type with the given kind and length. */
*************** gfc_get_logical_type (int kind)
*** 536,557 ****
tree
gfc_get_character_type_len (int kind, tree len)
{
! tree base;
! tree bounds;
! tree type;
!
! switch (kind)
! {
! case 1:
! base = gfc_character1_type_node;
! break;
! default:
! fatal_error ("character kind=%d not available", kind);
! }
bounds = build_range_type (gfc_array_index_type, gfc_index_one_node, len);
! type = build_array_type (base, bounds);
TYPE_STRING_FLAG (type) = 1;
return type;
--- 579,590 ----
tree
gfc_get_character_type_len (int kind, tree len)
{
! tree bounds, type;
! gfc_validate_kind (BT_CHARACTER, kind, false);
bounds = build_range_type (gfc_array_index_type, gfc_index_one_node, len);
! type = build_array_type (gfc_character1_type_node, bounds);
TYPE_STRING_FLAG (type) = 1;
return type;
*************** gfc_get_function_type (gfc_symbol * sym)
*** 1534,1541 ****
return type;
}
! /* Routines for getting integer type nodes. */
!
/* Return an integer type with BITS bits of precision,
that is unsigned if UNSIGNEDP is nonzero, otherwise signed. */
--- 1567,1573 ----
return type;
}
! /* Language hooks for middle-end access to type nodes. */
/* Return an integer type with BITS bits of precision,
that is unsigned if UNSIGNEDP is nonzero, otherwise signed. */
*************** gfc_get_function_type (gfc_symbol * sym)
*** 1543,1689 ****
tree
gfc_type_for_size (unsigned bits, int unsignedp)
{
! if (bits == TYPE_PRECISION (integer_type_node))
! return unsignedp ? unsigned_type_node : integer_type_node;
!
! if (bits == TYPE_PRECISION (signed_char_type_node))
! return unsignedp ? unsigned_char_type_node : signed_char_type_node;
!
! if (bits == TYPE_PRECISION (short_integer_type_node))
! return unsignedp ? short_unsigned_type_node : short_integer_type_node;
!
! if (bits == TYPE_PRECISION (long_integer_type_node))
! return unsignedp ? long_unsigned_type_node : long_integer_type_node;
!
! if (bits == TYPE_PRECISION (long_long_integer_type_node))
! return (unsignedp ? long_long_unsigned_type_node
! : long_long_integer_type_node);
! /*TODO: We currently don't initialise this...
! if (bits == TYPE_PRECISION (widest_integer_literal_type_node))
! return (unsignedp ? widest_unsigned_literal_type_node
! : widest_integer_literal_type_node);*/
!
! if (bits <= TYPE_PRECISION (intQI_type_node))
! return unsignedp ? unsigned_intQI_type_node : intQI_type_node;
!
! if (bits <= TYPE_PRECISION (intHI_type_node))
! return unsignedp ? unsigned_intHI_type_node : intHI_type_node;
!
! if (bits <= TYPE_PRECISION (intSI_type_node))
! return unsignedp ? unsigned_intSI_type_node : intSI_type_node;
!
! if (bits <= TYPE_PRECISION (intDI_type_node))
! return unsignedp ? unsigned_intDI_type_node : intDI_type_node;
! return 0;
}
! /* Return a data type that has machine mode MODE.
! If the mode is an integer,
! then UNSIGNEDP selects between signed and unsigned types. */
tree
gfc_type_for_mode (enum machine_mode mode, int unsignedp)
{
! if (mode == TYPE_MODE (integer_type_node))
! return unsignedp ? unsigned_type_node : integer_type_node;
!
! if (mode == TYPE_MODE (signed_char_type_node))
! return unsignedp ? unsigned_char_type_node : signed_char_type_node;
!
! if (mode == TYPE_MODE (short_integer_type_node))
! return unsignedp ? short_unsigned_type_node : short_integer_type_node;
!
! if (mode == TYPE_MODE (long_integer_type_node))
! return unsignedp ? long_unsigned_type_node : long_integer_type_node;
!
! if (mode == TYPE_MODE (long_long_integer_type_node))
! return unsignedp ? long_long_unsigned_type_node :
! long_long_integer_type_node;
!
! /*TODO: see above
! if (mode == TYPE_MODE (widest_integer_literal_type_node))
! return unsignedp ? widest_unsigned_literal_type_node
! : widest_integer_literal_type_node;
! */
!
! if (mode == QImode)
! return unsignedp ? unsigned_intQI_type_node : intQI_type_node;
!
! if (mode == HImode)
! return unsignedp ? unsigned_intHI_type_node : intHI_type_node;
!
! if (mode == SImode)
! return unsignedp ? unsigned_intSI_type_node : intSI_type_node;
!
! if (mode == DImode)
! return unsignedp ? unsigned_intDI_type_node : intDI_type_node;
!
! #if HOST_BITS_PER_WIDE_INT >= 64
! if (mode == TYPE_MODE (intTI_type_node))
! return unsignedp ? unsigned_intTI_type_node : intTI_type_node;
! #endif
!
! if (mode == TYPE_MODE (float_type_node))
! return float_type_node;
!
! if (mode == TYPE_MODE (double_type_node))
! return double_type_node;
!
! if (mode == TYPE_MODE (long_double_type_node))
! return long_double_type_node;
!
! if (mode == TYPE_MODE (build_pointer_type (char_type_node)))
! return build_pointer_type (char_type_node);
!
! if (mode == TYPE_MODE (build_pointer_type (integer_type_node)))
! return build_pointer_type (integer_type_node);
! if (VECTOR_MODE_P (mode))
{
enum machine_mode inner_mode = GET_MODE_INNER (mode);
tree inner_type = gfc_type_for_mode (inner_mode, unsignedp);
if (inner_type != NULL_TREE)
return build_vector_type_for_mode (inner_type, mode);
}
! return 0;
}
! /* Return an unsigned type the same as TYPE in other respects. */
tree
! gfc_unsigned_type (tree type)
{
! tree type1 = TYPE_MAIN_VARIANT (type);
! if (type1 == signed_char_type_node || type1 == char_type_node)
! return unsigned_char_type_node;
! if (type1 == integer_type_node)
! return unsigned_type_node;
! if (type1 == short_integer_type_node)
! return short_unsigned_type_node;
! if (type1 == long_integer_type_node)
! return long_unsigned_type_node;
! if (type1 == long_long_integer_type_node)
! return long_long_unsigned_type_node;
! /*TODO :see others
! if (type1 == widest_integer_literal_type_node)
! return widest_unsigned_literal_type_node;
! */
! #if HOST_BITS_PER_WIDE_INT >= 64
! if (type1 == intTI_type_node)
! return unsigned_intTI_type_node;
! #endif
! if (type1 == intDI_type_node)
! return unsigned_intDI_type_node;
! if (type1 == intSI_type_node)
! return unsigned_intSI_type_node;
! if (type1 == intHI_type_node)
! return unsigned_intHI_type_node;
! if (type1 == intQI_type_node)
! return unsigned_intQI_type_node;
return gfc_signed_or_unsigned_type (1, type);
}
--- 1575,1660 ----
tree
gfc_type_for_size (unsigned bits, int unsignedp)
{
! if (!unsignedp)
! {
! int i;
! for (i = 0; i <= MAX_INT_KINDS; ++i)
! {
! tree type = gfc_integer_types[i];
! if (type && bits == TYPE_PRECISION (type))
! return type;
! }
! }
! else
! {
! if (bits == TYPE_PRECISION (unsigned_intQI_type_node))
! return unsigned_intQI_type_node;
! if (bits == TYPE_PRECISION (unsigned_intHI_type_node))
! return unsigned_intHI_type_node;
! if (bits == TYPE_PRECISION (unsigned_intSI_type_node))
! return unsigned_intSI_type_node;
! if (bits == TYPE_PRECISION (unsigned_intDI_type_node))
! return unsigned_intDI_type_node;
! if (bits == TYPE_PRECISION (unsigned_intTI_type_node))
! return unsigned_intTI_type_node;
! }
! return NULL_TREE;
}
! /* Return a data type that has machine mode MODE. If the mode is an
! integer, then UNSIGNEDP selects between signed and unsigned types. */
tree
gfc_type_for_mode (enum machine_mode mode, int unsignedp)
{
! int i;
! tree *base;
! if (GET_MODE_CLASS (mode) == MODE_FLOAT)
! base = gfc_real_types;
! else if (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT)
! base = gfc_complex_types;
! else if (SCALAR_INT_MODE_P (mode))
! return gfc_type_for_size (GET_MODE_PRECISION (mode), unsignedp);
! else if (VECTOR_MODE_P (mode))
{
enum machine_mode inner_mode = GET_MODE_INNER (mode);
tree inner_type = gfc_type_for_mode (inner_mode, unsignedp);
if (inner_type != NULL_TREE)
return build_vector_type_for_mode (inner_type, mode);
+ return NULL_TREE;
}
+ else
+ abort ();
! for (i = 0; i <= MAX_REAL_KINDS; ++i)
! {
! tree type = base[i];
! if (type && mode == TYPE_MODE (type))
! return type;
! }
!
! return NULL_TREE;
}
! /* Return a type the same as TYPE except unsigned or
! signed according to UNSIGNEDP. */
tree
! gfc_signed_or_unsigned_type (int unsignedp, tree type)
{
! if (TREE_CODE (type) != INTEGER_TYPE || TYPE_UNSIGNED (type) == unsignedp)
! return type;
! else
! return gfc_type_for_size (TYPE_PRECISION (type), unsignedp);
! }
! /* Return an unsigned type the same as TYPE in other respects. */
+ tree
+ gfc_unsigned_type (tree type)
+ {
return gfc_signed_or_unsigned_type (1, type);
}
*************** gfc_unsigned_type (tree type)
*** 1692,1768 ****
tree
gfc_signed_type (tree type)
{
- tree type1 = TYPE_MAIN_VARIANT (type);
-
- if (type1 == unsigned_char_type_node || type1 == char_type_node)
- return signed_char_type_node;
- if (type1 == unsigned_type_node)
- return integer_type_node;
- if (type1 == short_unsigned_type_node)
- return short_integer_type_node;
- if (type1 == long_unsigned_type_node)
- return long_integer_type_node;
- if (type1 == long_long_unsigned_type_node)
- return long_long_integer_type_node;
- /*TODO: see others
- if (type1 == widest_unsigned_literal_type_node)
- return widest_integer_literal_type_node;
- */
- #if HOST_BITS_PER_WIDE_INT >= 64
- if (type1 == unsigned_intTI_type_node)
- return intTI_type_node;
- #endif
- if (type1 == unsigned_intDI_type_node)
- return intDI_type_node;
- if (type1 == unsigned_intSI_type_node)
- return intSI_type_node;
- if (type1 == unsigned_intHI_type_node)
- return intHI_type_node;
- if (type1 == unsigned_intQI_type_node)
- return intQI_type_node;
-
return gfc_signed_or_unsigned_type (0, type);
}
- /* Return a type the same as TYPE except unsigned or
- signed according to UNSIGNEDP. */
-
- tree
- gfc_signed_or_unsigned_type (int unsignedp, tree type)
- {
- if (!INTEGRAL_TYPE_P (type) || TYPE_UNSIGNED (type) == unsignedp)
- return type;
-
- if (TYPE_PRECISION (type) == TYPE_PRECISION (signed_char_type_node))
- return unsignedp ? unsigned_char_type_node : signed_char_type_node;
- if (TYPE_PRECISION (type) == TYPE_PRECISION (integer_type_node))
- return unsignedp ? unsigned_type_node : integer_type_node;
- if (TYPE_PRECISION (type) == TYPE_PRECISION (short_integer_type_node))
- return unsignedp ? short_unsigned_type_node : short_integer_type_node;
- if (TYPE_PRECISION (type) == TYPE_PRECISION (long_integer_type_node))
- return unsignedp ? long_unsigned_type_node : long_integer_type_node;
- if (TYPE_PRECISION (type) == TYPE_PRECISION (long_long_integer_type_node))
- return (unsignedp ? long_long_unsigned_type_node
- : long_long_integer_type_node);
- /*TODO: see others
- if (TYPE_PRECISION (type) == TYPE_PRECISION (widest_integer_literal_type_node))
- return (unsignedp ? widest_unsigned_literal_type_node
- : widest_integer_literal_type_node);
- */
- #if HOST_BITS_PER_WIDE_INT >= 64
- if (TYPE_PRECISION (type) == TYPE_PRECISION (intTI_type_node))
- return unsignedp ? unsigned_intTI_type_node : intTI_type_node;
- #endif
- if (TYPE_PRECISION (type) == TYPE_PRECISION (intDI_type_node))
- return unsignedp ? unsigned_intDI_type_node : intDI_type_node;
- if (TYPE_PRECISION (type) == TYPE_PRECISION (intSI_type_node))
- return unsignedp ? unsigned_intSI_type_node : intSI_type_node;
- if (TYPE_PRECISION (type) == TYPE_PRECISION (intHI_type_node))
- return unsignedp ? unsigned_intHI_type_node : intHI_type_node;
- if (TYPE_PRECISION (type) == TYPE_PRECISION (intQI_type_node))
- return unsignedp ? unsigned_intQI_type_node : intQI_type_node;
-
- return type;
- }
-
#include "gt-fortran-trans-types.h"
--- 1663,1669 ----
Index: trans-types.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/trans-types.h,v
retrieving revision 1.5
diff -c -p -d -r1.5 trans-types.h
*** trans-types.h 26 Aug 2004 22:19:23 -0000 1.5
--- trans-types.h 30 Aug 2004 21:45:35 -0000
*************** Software Foundation, 59 Temple Place - S
*** 24,51 ****
#ifndef GFC_BACKEND_H
#define GFC_BACKEND_H
- enum
- {
- F95_INT1_TYPE,
- F95_INT2_TYPE,
- F95_INT4_TYPE,
- F95_INT8_TYPE,
- F95_INT16_TYPE,
- F95_REAL4_TYPE,
- F95_REAL8_TYPE,
- F95_REAl16_TYPE,
- F95_COMPLEX4_TYPE,
- F95_COMPLEX8_TYPE,
- F95_COMPLEX16_TYPE,
- F95_LOGICAL1_TYPE,
- F95_LOGICAL2_TYPE,
- F95_LOGICAL4_TYPE,
- F95_LOGICAL8_TYPE,
- F95_LOGICAL16_TYPE,
- F95_CHARACTER1_TYPE,
- NUM_F95_TYPES
- };
-
#define GFC_DTYPE_RANK_MASK 0x07
#define GFC_DTYPE_TYPE_SHIFT 3
#define GFC_DTYPE_TYPE_MASK 0x38
--- 24,29 ----
*************** enum
*** 62,98 ****
GFC_DTYPE_CHARACTER
};
- extern GTY(()) tree gfc_type_nodes[NUM_F95_TYPES];
-
extern GTY(()) tree gfc_array_index_type;
extern GTY(()) tree ppvoid_type_node;
extern GTY(()) tree pvoid_type_node;
extern GTY(()) tree pchar_type_node;
!
! #define gfc_int1_type_node gfc_type_nodes[F95_INT1_TYPE]
! #define gfc_int2_type_node gfc_type_nodes[F95_INT2_TYPE]
! #define gfc_int4_type_node gfc_type_nodes[F95_INT4_TYPE]
! #define gfc_int8_type_node gfc_type_nodes[F95_INT8_TYPE]
! #define gfc_int16_type_node gfc_type_nodes[F95_INT16_TYPE]
!
! #define gfc_real4_type_node gfc_type_nodes[F95_REAL4_TYPE]
! #define gfc_real8_type_node gfc_type_nodes[F95_REAL8_TYPE]
! #define gfc_real16_type_node gfc_type_nodes[F95_REAL16_TYPE]
!
! #define gfc_complex4_type_node gfc_type_nodes[F95_COMPLEX4_TYPE]
! #define gfc_complex8_type_node gfc_type_nodes[F95_COMPLEX8_TYPE]
! #define gfc_complex16_type_node gfc_type_nodes[F95_COMPLEX16_TYPE]
!
! #define gfc_logical1_type_node gfc_type_nodes[F95_LOGICAL1_TYPE]
! #define gfc_logical2_type_node gfc_type_nodes[F95_LOGICAL2_TYPE]
! #define gfc_logical4_type_node gfc_type_nodes[F95_LOGICAL4_TYPE]
! #define gfc_logical8_type_node gfc_type_nodes[F95_LOGICAL8_TYPE]
! #define gfc_logical16_type_node gfc_type_nodes[F95_LOGICAL16_TYPE]
!
! #define gfc_character1_type_node gfc_type_nodes[F95_CHARACTER1_TYPE]
!
! #define gfc_strlen_kind 4
! #define gfc_strlen_type_node gfc_int4_type_node
/* These C-specific types are used while building builtin function decls.
For now it doesn't really matter what these are defined to as we don't
--- 40,51 ----
GFC_DTYPE_CHARACTER
};
extern GTY(()) tree gfc_array_index_type;
+ extern GTY(()) tree gfc_character1_type_node;
extern GTY(()) tree ppvoid_type_node;
extern GTY(()) tree pvoid_type_node;
extern GTY(()) tree pchar_type_node;
! extern GTY(()) tree gfc_strlen_type_node;
/* These C-specific types are used while building builtin function decls.
For now it doesn't really matter what these are defined to as we don't