diff options
Diffstat (limited to 'gcc/ada')
-rw-r--r-- | gcc/ada/ChangeLog | 55 | ||||
-rw-r--r-- | gcc/ada/Make-lang.in | 15 | ||||
-rw-r--r-- | gcc/ada/ada-tree.h | 72 | ||||
-rw-r--r-- | gcc/ada/config-lang.in | 2 | ||||
-rw-r--r-- | gcc/ada/decl.c | 97 | ||||
-rw-r--r-- | gcc/ada/gigi.h | 6 | ||||
-rw-r--r-- | gcc/ada/gnat_rm.texi | 2 | ||||
-rw-r--r-- | gcc/ada/misc.c | 50 | ||||
-rw-r--r-- | gcc/ada/prj-makr.adb | 1 | ||||
-rw-r--r-- | gcc/ada/prj-makr.ads | 1 | ||||
-rw-r--r-- | gcc/ada/prj-pp.adb | 1 | ||||
-rw-r--r-- | gcc/ada/prj-pp.ads | 1 | ||||
-rw-r--r-- | gcc/ada/trans.c | 14 | ||||
-rw-r--r-- | gcc/ada/utils.c | 90 | ||||
-rw-r--r-- | gcc/ada/utils2.c | 4 |
15 files changed, 217 insertions, 194 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index a17ab035798..0f28390b3ce 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,58 @@ +2002-06-03 Geoffrey Keating <geoffk@redhat.com> + + Merge from pch-branch: + + * config-lang.in (gtfiles): Add ada-tree.h. + * ada-tree.h (SET_TYPE_CI_CO_LIST): New. + (SET_TYPE_MODULUS): New. + (SET_TYPE_INDEX): New. + (SET_TYPE_DIGITS_VALUE): New. + (SET_TYPE_RM_SIZE): New. + (SET_TYPE_UNCONSTRAINED_ARRAY): New. + (SET_TYPE_ADA_SIZE): New. + (SET_TYPE_ACTUAL_BOUNDS): New. + (SET_DECL_CONST_CORRESPONDING_VAR): New. + (SET_DECL_ORIGINAL_FIELD): New. + (TREE_LOOP_ID): Correct typo. + * decl.c: Use new macros. + * utils.c: Include debug.h, use new macros. + * utils2.c: Use new macros. + + * ada-tree.h: Update all macros for new tree description. + (struct tree_loop_id): New. + (union lang_tree_node): New. + (struct lang_decl): New. + (struct lang_type): New. + * misc.c (gnat_mark_tree): Delete. + (LANG_HOOKS_MARK_TREE): Delete. + * trans.c (tree_transform): No longer any need to cast + for TREE_LOOP_ID. + + * utils.c (struct language_function): New dummy structure. + + * Makefile.in (decl.o): gt-ada-<filename.h> is in objdir, not srcdir. + (misc.o): Likewise. + (utils.o): Likewise; also gtype-ada.h. + * Make-lang.in (gnat1): Add dependency on s-gtype. + (gnatbind): Add dependency on $(CONFIG_H). + * utils.c: Correct last #include. + (stuct e_stack): Remove unnecessary 'static'. + (mark_e_stack): Remove unused prototype. + + * scn-nlit.adb: Remove whitespace after version number to + keep lines under 80 chars. + * snames.adb: Likewise. + * treepr.ads: Likewise. + + * Makefile.in (decl.o): Include gt-ada-<filename>.h. + (misc.o): Likewise. + (utils.o): Include gt-ada-<filename>.h and gtype-ada.h. + * config-lang.in (gtfiles): New. + * decl.c: Use gengtype for roots. + * gigi.h: Use gengtype for roots. + * trans.c: Use gengtype for roots. + * utils.c: Use gengtype for roots, marking. Include gtype-ada.h. + 2002-06-02 Gabriel Dos Reis <gdr@codesourcery.com> * misc.c (gnat_init): Adjust setting of internal_error_function. diff --git a/gcc/ada/Make-lang.in b/gcc/ada/Make-lang.in index 67a52df542c..af91c322826 100644 --- a/gcc/ada/Make-lang.in +++ b/gcc/ada/Make-lang.in @@ -205,10 +205,6 @@ gnat1$(exeext): $(TARGET_ADA_SRCS) $(GNAT1_OBJS) $(ADA_BACKEND) $(LIBDEPS) $(SYSLIBS) $(RM) stamp-gnatlib2 stamp-tools -gnatbind$(exeext): ada/b_gnatb.o $(GNATBIND_OBJS) - $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ ada/b_gnatb.o $(GNATBIND_OBJS) \ - $(LIBIBERTY) $(LIBS) - # use target-gcc target-gnatmake target-gnatbind target-gnatlink gnattools: $(GCC_PARTS) $(CONFIG_H) prefix.o force $(MAKE) -C ada $(FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) \ @@ -272,6 +268,9 @@ gnatlib_and_tools: gnatlib gnattools # use cross-gcc gnat-cross: force $(MAKE) -C ada $(FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) gnat-cross + +gt-ada-decl.h gt-ada-trans.h gt-ada-utils.h gtype-ada.h : s-gtype ; @true + # Build hooks: @@ -1002,7 +1001,8 @@ ada/cuintp.o : ada/cuintp.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) ada/ada.h \ ada/decl.o : ada/decl.c $(CONFIG_H) $(TREE_H) $(srcdir)/flags.h \ $(srcdir)/toplev.h $(srcdir)/convert.h ada/ada.h ada/types.h ada/atree.h \ ada/nlists.h ada/elists.h ada/uintp.h ada/sinfo.h ada/einfo.h ada/snames.h \ - ada/namet.h ada/stringt.h ada/repinfo.h ada/fe.h $(ADA_TREE_H) ada/gigi.h + ada/namet.h ada/stringt.h ada/repinfo.h ada/fe.h $(ADA_TREE_H) ada/gigi.h \ + gt-ada-decl.h ada/misc.o : ada/misc.c $(CONFIG_H) $(TREE_H) $(RTL_H) $(srcdir)/expr.h \ insn-codes.h insn-flags.h insn-config.h $(srcdir)/recog.h \ @@ -1020,12 +1020,13 @@ ada/targtyps.o : ada/targtyps.c $(CONFIG_H) ada/ada.h ada/types.h ada/atree.h \ ada/trans.o : ada/trans.c $(CONFIG_H) $(TREE_H) $(RTL_H) $(srcdir)/flags.h \ ada/ada.h $(srcdir)/except.h ada/types.h ada/atree.h ada/nlists.h \ ada/elists.h ada/uintp.h ada/sinfo.h ada/einfo.h ada/namet.h ada/snames.h \ - ada/stringt.h ada/urealp.h ada/fe.h $(ADA_TREE_H) ada/gigi.h + ada/stringt.h ada/urealp.h ada/fe.h $(ADA_TREE_H) ada/gigi.h gt-ada-trans.h ada/utils.o : ada/utils.c $(CONFIG_H) $(TREE_H) $(srcdir)/flags.h \ $(srcdir)/expr.h $(srcdir)/convert.h $(srcdir)/defaults.h ada/ada.h \ ada/types.h ada/atree.h ada/nlists.h ada/elists.h ada/sinfo.h ada/einfo.h \ - ada/namet.h ada/stringt.h ada/uintp.h ada/fe.h $(ADA_TREE_H) ada/gigi.h + ada/namet.h ada/stringt.h ada/uintp.h ada/fe.h $(ADA_TREE_H) ada/gigi.h \ + gt-ada-utils.h gtype-ada.h ada/utils2.o : ada/utils2.c $(CONFIG_H) $(TREE_H) $(srcdir)/flags.h ada/ada.h \ ada/types.h ada/atree.h ada/nlists.h ada/elists.h ada/sinfo.h ada/einfo.h \ diff --git a/gcc/ada/ada-tree.h b/gcc/ada/ada-tree.h index 40435d72393..b22f081bb6a 100644 --- a/gcc/ada/ada-tree.h +++ b/gcc/ada/ada-tree.h @@ -34,6 +34,35 @@ enum gnat_tree_code { }; #undef DEFTREECODE +/* A tree to hold a loop ID. */ +struct tree_loop_id GTY(()) +{ + struct tree_common common; + struct nesting *loop_id; +}; + +/* The language-specific tree. */ +union lang_tree_node + GTY((desc ("TREE_CODE (&%h.generic) == GNAT_LOOP_ID"))) +{ + union tree_node GTY ((tag ("0"), + desc ("tree_node_structure (&%h)"))) + generic; + struct tree_loop_id GTY ((tag ("1"))) loop_id; +}; + +/* Ada uses the lang_decl and lang_type fields to hold more trees. */ +struct lang_decl GTY(()) +{ + union lang_tree_node + GTY((desc ("TREE_CODE (&%h.generic) == GNAT_LOOP_ID"))) t; +}; +struct lang_type GTY(()) +{ + union lang_tree_node + GTY((desc ("TREE_CODE (&%h.generic) == GNAT_LOOP_ID"))) t; +}; + /* Flags added to GCC type nodes. */ /* For RECORD_TYPE, UNION_TYPE, and QUAL_UNION_TYPE, nonzero if this is a @@ -129,29 +158,39 @@ enum gnat_tree_code { by copy in copy out. It is a CONSTRUCTOR. For a full description of the cico parameter passing mechanism refer to the routine gnat_to_gnu_entity. */ #define TYPE_CI_CO_LIST(NODE) \ - (tree) TYPE_LANG_SPECIFIC (FUNCTION_TYPE_CHECK (NODE)) + (&TYPE_LANG_SPECIFIC (FUNCTION_TYPE_CHECK (NODE))->t.generic) +#define SET_TYPE_CI_CO_LIST(NODE, X) \ + (TYPE_LANG_SPECIFIC (FUNCTION_TYPE_CHECK (NODE)) = (struct lang_type *)(X)) /* For an INTEGER_TYPE with TYPE_MODULAR_P, this is the value of the modulus. */ #define TYPE_MODULUS(NODE) \ - (tree) TYPE_LANG_SPECIFIC (INTEGER_TYPE_CHECK (NODE)) + (&TYPE_LANG_SPECIFIC (INTEGER_TYPE_CHECK (NODE))->t.generic) +#define SET_TYPE_MODULUS(NODE, X) \ + (TYPE_LANG_SPECIFIC (INTEGER_TYPE_CHECK (NODE)) = (struct lang_type *)(X)) /* For an INTEGER_TYPE that is the TYPE_DOMAIN of some ARRAY_TYPE, points to the type corresponding to the Ada index type. */ #define TYPE_INDEX_TYPE(NODE) \ - (tree) TYPE_LANG_SPECIFIC (INTEGER_TYPE_CHECK (NODE)) + (&TYPE_LANG_SPECIFIC (INTEGER_TYPE_CHECK (NODE))->t.generic) +#define SET_TYPE_INDEX_TYPE(NODE, X) \ + (TYPE_LANG_SPECIFIC (INTEGER_TYPE_CHECK (NODE)) = (struct lang_type *)(X)) /* For an INTEGER_TYPE with TYPE_VAX_FLOATING_POINT_P, stores the Digits_Value. */ #define TYPE_DIGITS_VALUE(NODE) \ - (long) TYPE_LANG_SPECIFIC (INTEGER_TYPE_CHECK (NODE)) + ((long) TYPE_LANG_SPECIFIC (INTEGER_TYPE_CHECK (NODE))) +#define SET_TYPE_DIGITS_VALUE(NODE, X) \ + (TYPE_LANG_SPECIFIC (INTEGER_TYPE_CHECK (NODE)) = (struct lang_type *)(X)) /* For INTEGER_TYPE, stores the RM_Size of the type. */ #define TYPE_RM_SIZE_INT(NODE) TYPE_VALUES (INTEGER_TYPE_CHECK (NODE)) /* Likewise for ENUMERAL_TYPE. */ #define TYPE_RM_SIZE_ENUM(NODE) \ - (tree) TYPE_LANG_SPECIFIC (ENUMERAL_TYPE_CHECK (NODE)) + (&TYPE_LANG_SPECIFIC (ENUMERAL_TYPE_CHECK (NODE))->t.generic) +#define SET_TYPE_RM_SIZE_ENUM(NODE, X) \ + (TYPE_LANG_SPECIFIC (ENUMERAL_TYPE_CHECK (NODE)) = (struct lang_type *)(X)) #define TYPE_RM_SIZE(NODE) \ (TREE_CODE (NODE) == ENUMERAL_TYPE ? TYPE_RM_SIZE_ENUM (NODE) \ @@ -162,17 +201,23 @@ enum gnat_tree_code { unconstrained object. Likewise for a RECORD_TYPE that is pointed to by a thin pointer. */ #define TYPE_UNCONSTRAINED_ARRAY(NODE) \ - (tree) TYPE_LANG_SPECIFIC (RECORD_TYPE_CHECK (NODE)) + (&TYPE_LANG_SPECIFIC (RECORD_TYPE_CHECK (NODE))->t.generic) +#define SET_TYPE_UNCONSTRAINED_ARRAY(NODE, X) \ + (TYPE_LANG_SPECIFIC (RECORD_TYPE_CHECK (NODE)) = (struct lang_type *)(X)) /* For other RECORD_TYPEs and all UNION_TYPEs and QUAL_UNION_TYPEs, the Ada size of the object. This differs from the GCC size in that it does not include any rounding up to the alignment of the type. */ -#define TYPE_ADA_SIZE(NODE) (tree) TYPE_LANG_SPECIFIC (NODE) +#define TYPE_ADA_SIZE(NODE) (&TYPE_LANG_SPECIFIC (NODE)->t.generic) +#define SET_TYPE_ADA_SIZE(NODE, X) \ + (TYPE_LANG_SPECIFIC (NODE) = (struct lang_type *)(X)) /* For an INTEGER_TYPE with TYPE_HAS_ACTUAL_BOUNDS_P or an ARRAY_TYPE, this is the index type that should be used when the actual bounds are required for a template. This is used in the case of packed arrays. */ -#define TYPE_ACTUAL_BOUNDS(NODE) (tree) TYPE_LANG_SPECIFIC (NODE) +#define TYPE_ACTUAL_BOUNDS(NODE) (&TYPE_LANG_SPECIFIC (NODE)->t.generic) +#define SET_TYPE_ACTUAL_BOUNDS(NODE, X) \ + (TYPE_LANG_SPECIFIC (NODE) = (struct lang_type *)(X)) /* In an UNCONSTRAINED_ARRAY_TYPE, points to the record containing both the template and object. */ @@ -211,12 +256,16 @@ enum gnat_tree_code { memory. Used when a scalar constant is aliased or has its address taken. */ #define DECL_CONST_CORRESPONDING_VAR(NODE) \ - (tree) DECL_LANG_SPECIFIC (CONST_DECL_CHECK (NODE)) + (&DECL_LANG_SPECIFIC (CONST_DECL_CHECK (NODE))->t.generic) +#define SET_DECL_CONST_CORRESPONDING_VAR(NODE, X) \ + (DECL_LANG_SPECIFIC (CONST_DECL_CHECK (NODE)) = (struct lang_decl *)(X)) /* In a FIELD_DECL, points to the FIELD_DECL that was the ultimate source of the decl. */ #define DECL_ORIGINAL_FIELD(NODE) \ - (tree) DECL_LANG_SPECIFIC (FIELD_DECL_CHECK (NODE)) + (&DECL_LANG_SPECIFIC (FIELD_DECL_CHECK (NODE))->t.generic) +#define SET_DECL_ORIGINAL_FIELD(NODE, X) \ + (DECL_LANG_SPECIFIC (FIELD_DECL_CHECK (NODE)) = (struct lang_decl *)(X)) /* In a FIELD_DECL corresponding to a discriminant, contains the discriminant number. */ @@ -224,4 +273,5 @@ enum gnat_tree_code { /* This is a horrible kludge to store the loop_id of a loop into a tree node. We need to find some other place to store it! */ -#define TREE_LOOP_ID(NODE) (TREE_CHECK (NODE, GNAT_LOOP_ID)->real_cst.rtl) +#define TREE_LOOP_ID(NODE) \ + (((union lang_tree_node *)TREE_CHECK (NODE, GNAT_LOOP_ID))->loop_id.loop_id) diff --git a/gcc/ada/config-lang.in b/gcc/ada/config-lang.in index d9029c14b8d..b0fe156af13 100644 --- a/gcc/ada/config-lang.in +++ b/gcc/ada/config-lang.in @@ -35,6 +35,8 @@ compilers="gnat1\$(exeext)" stagestuff="gnatbind\$(exeext) gnat1\$(exeext)" +gtfiles="\$(srcdir)/ada/ada-tree.h \$(srcdir)/ada/gigi.h \$(srcdir)/ada/decl.c \$(srcdir)/ada/trans.c \$(srcdir)/ada/utils.c" + diff_excludes="-x ada/a-einfo.h -x ada/a-sinfo.h -x ada/nmake.adb -x ada/nmake.ads -x ada/treeprs.ads -x ada/sysid.ads" outputs=ada/Makefile diff --git a/gcc/ada/decl.c b/gcc/ada/decl.c index adf1d35744b..fbced93ffd1 100644 --- a/gcc/ada/decl.c +++ b/gcc/ada/decl.c @@ -1044,10 +1044,10 @@ gnat_to_gnu_entity (gnat_entity, gnu_expr, definition) || Address_Taken (gnat_entity) || Is_Aliased (gnat_entity) || Is_Aliased (Etype (gnat_entity)))) - DECL_CONST_CORRESPONDING_VAR (gnu_decl) - = create_var_decl (gnu_entity_id, gnu_ext_name, gnu_type, + SET_DECL_CONST_CORRESPONDING_VAR (gnu_decl, + create_var_decl (gnu_entity_id, gnu_ext_name, gnu_type, gnu_expr, 0, Is_Public (gnat_entity), 0, - static_p, 0); + static_p, 0)); /* If this is declared in a block that contains an block with an exception handler, we must force this variable in memory to @@ -1184,7 +1184,7 @@ gnat_to_gnu_entity (gnat_entity, gnu_expr, definition) if (! integer_zerop (gnu_modulus)) { TYPE_MODULAR_P (gnu_type) = 1; - TYPE_MODULUS (gnu_type) = gnu_modulus; + SET_TYPE_MODULUS (gnu_type, gnu_modulus); gnu_high = fold (build (MINUS_EXPR, gnu_type, gnu_modulus, convert (gnu_type, integer_one_node))); } @@ -1308,7 +1308,7 @@ gnat_to_gnu_entity (gnat_entity, gnu_expr, definition) gnu_field_type, gnu_type, 1, 0, 0, 1), finish_record_type (gnu_type, gnu_field, 0, 0); TYPE_LEFT_JUSTIFIED_MODULAR_P (gnu_type) = 1; - TYPE_ADA_SIZE (gnu_type) = bitsize_int (esize); + SET_TYPE_ADA_SIZE (gnu_type, bitsize_int (esize)); } break; @@ -1320,8 +1320,8 @@ gnat_to_gnu_entity (gnat_entity, gnu_expr, definition) { gnu_type = make_signed_type (esize); TYPE_VAX_FLOATING_POINT_P (gnu_type) = 1; - TYPE_DIGITS_VALUE (gnu_type) - = UI_To_Int (Digits_Value (gnat_entity)); + SET_TYPE_DIGITS_VALUE (gnu_type, + UI_To_Int (Digits_Value (gnat_entity))); break; } @@ -1619,7 +1619,7 @@ gnat_to_gnu_entity (gnat_entity, gnu_expr, definition) = TYPE_REFERENCE_TO (gnu_type) = gnu_fat_type; TYPE_MODE (gnu_type) = BLKmode; TYPE_ALIGN (gnu_type) = TYPE_ALIGN (tem); - TYPE_UNCONSTRAINED_ARRAY (gnu_fat_type) = gnu_type; + SET_TYPE_UNCONSTRAINED_ARRAY (gnu_fat_type, gnu_type); /* If the maximum size doesn't overflow, use it. */ if (TREE_CODE (gnu_max_size) == INTEGER_CST @@ -1647,7 +1647,7 @@ gnat_to_gnu_entity (gnat_entity, gnu_expr, definition) DECL_FIELD_OFFSET (TREE_CHAIN (TYPE_FIELDS (tem))) = size_zero_node; DECL_FIELD_BIT_OFFSET (TREE_CHAIN (TYPE_FIELDS (tem))) = bitsize_zero_node; - TYPE_UNCONSTRAINED_ARRAY (tem) = gnu_type; + SET_TYPE_UNCONSTRAINED_ARRAY (tem, gnu_type); TYPE_OBJECT_RECORD_TYPE (gnu_type) = tem; /* Give the thin pointer type a name. */ @@ -2066,18 +2066,18 @@ gnat_to_gnu_entity (gnat_entity, gnu_expr, definition) TYPE_HAS_ACTUAL_BOUNDS_P (gnu_inner_type) = 1; } - TYPE_ACTUAL_BOUNDS (gnu_inner_type) = NULL_TREE; + SET_TYPE_ACTUAL_BOUNDS (gnu_inner_type, NULL_TREE); for (gnat_index = First_Index (gnat_entity); Present (gnat_index); gnat_index = Next_Index (gnat_index)) - TYPE_ACTUAL_BOUNDS (gnu_inner_type) - = tree_cons (NULL_TREE, + SET_TYPE_ACTUAL_BOUNDS (gnu_inner_type, + tree_cons (NULL_TREE, get_unpadded_type (Etype (gnat_index)), - TYPE_ACTUAL_BOUNDS (gnu_inner_type)); + TYPE_ACTUAL_BOUNDS (gnu_inner_type))); if (Convention (gnat_entity) != Convention_Fortran) - TYPE_ACTUAL_BOUNDS (gnu_inner_type) - = nreverse (TYPE_ACTUAL_BOUNDS (gnu_inner_type)); + SET_TYPE_ACTUAL_BOUNDS (gnu_inner_type, + nreverse (TYPE_ACTUAL_BOUNDS (gnu_inner_type))); if (TREE_CODE (gnu_type) == RECORD_TYPE && TYPE_LEFT_JUSTIFIED_MODULAR_P (gnu_type)) @@ -2577,9 +2577,10 @@ gnat_to_gnu_entity (gnat_entity, gnu_expr, definition) DECL_INTERNAL_P (gnu_field) = DECL_INTERNAL_P (gnu_old_field); - DECL_ORIGINAL_FIELD (gnu_field) - = DECL_ORIGINAL_FIELD (gnu_old_field) != 0 - ? DECL_ORIGINAL_FIELD (gnu_old_field) : gnu_old_field; + SET_DECL_ORIGINAL_FIELD (gnu_field, + (DECL_ORIGINAL_FIELD (gnu_old_field) != 0 + ? DECL_ORIGINAL_FIELD (gnu_old_field) + : gnu_old_field)); DECL_DISCRIMINANT_NUMBER (gnu_field) = DECL_DISCRIMINANT_NUMBER (gnu_old_field); TREE_THIS_VOLATILE (gnu_field) @@ -2598,7 +2599,7 @@ gnat_to_gnu_entity (gnat_entity, gnu_expr, definition) TYPE_ALIGN (gnu_type) = TYPE_ALIGN (gnu_base_type); TYPE_SIZE (gnu_type) = TYPE_SIZE (gnu_base_type); TYPE_SIZE_UNIT (gnu_type) = TYPE_SIZE_UNIT (gnu_base_type); - TYPE_ADA_SIZE (gnu_type) = TYPE_ADA_SIZE (gnu_base_type); + SET_TYPE_ADA_SIZE (gnu_type, TYPE_ADA_SIZE (gnu_base_type)); if (TREE_CODE (TYPE_SIZE (gnu_type)) != INTEGER_CST && contains_placeholder_p (TYPE_SIZE (gnu_type))) @@ -2623,10 +2624,10 @@ gnat_to_gnu_entity (gnat_entity, gnu_expr, definition) && contains_placeholder_p (TYPE_ADA_SIZE (gnu_type))) for (gnu_temp = gnu_subst_list; gnu_temp; gnu_temp = TREE_CHAIN (gnu_temp)) - TYPE_ADA_SIZE (gnu_type) - = substitute_in_expr (TYPE_ADA_SIZE (gnu_type), + SET_TYPE_ADA_SIZE (gnu_type, + substitute_in_expr (TYPE_ADA_SIZE (gnu_type), TREE_PURPOSE (gnu_temp), - TREE_VALUE (gnu_temp)); + TREE_VALUE (gnu_temp))); /* Recompute the mode of this record type now that we know its actual size. */ @@ -2816,7 +2817,7 @@ gnat_to_gnu_entity (gnat_entity, gnu_expr, definition) if (gnu_type == 0) { gnu_type = make_node (RECORD_TYPE); - TYPE_UNCONSTRAINED_ARRAY (gnu_type) = gnu_old; + SET_TYPE_UNCONSTRAINED_ARRAY (gnu_type, gnu_old); TYPE_POINTER_TO (gnu_old) = gnu_type; set_lineno (gnat_entity, 0); @@ -3670,11 +3671,14 @@ gnat_to_gnu_entity (gnat_entity, gnu_expr, definition) if (TREE_CODE (gnu_type) == RECORD_TYPE && operand_equal_p (TYPE_ADA_SIZE (gnu_type), TYPE_SIZE (gnu_type), 0)) - TYPE_ADA_SIZE (gnu_type) = TYPE_SIZE (gnu_type) - = elaborate_expression_1 (gnat_entity, gnat_entity, - TYPE_SIZE (gnu_type), - get_identifier ("SIZE"), - definition, 0); + { + TYPE_SIZE (gnu_type) + = elaborate_expression_1 (gnat_entity, gnat_entity, + TYPE_SIZE (gnu_type), + get_identifier ("SIZE"), + definition, 0); + SET_TYPE_ADA_SIZE (gnu_type, TYPE_SIZE (gnu_type)); + } else { TYPE_SIZE (gnu_type) @@ -3699,11 +3703,11 @@ gnat_to_gnu_entity (gnat_entity, gnu_expr, definition) size_int (TYPE_ALIGN (gnu_type) / BITS_PER_UNIT)); if (TREE_CODE (gnu_type) == RECORD_TYPE) - TYPE_ADA_SIZE (gnu_type) - = elaborate_expression_1 (gnat_entity, gnat_entity, + SET_TYPE_ADA_SIZE (gnu_type, + elaborate_expression_1 (gnat_entity, gnat_entity, TYPE_ADA_SIZE (gnu_type), get_identifier ("RM_SIZE"), - definition, 0); + definition, 0)); } } @@ -4040,7 +4044,7 @@ substitution_list (gnat_subtype, gnat_type, gnu_list, definition) /* For the following two functions: for each GNAT entity, the GCC tree node used as a dummy for that entity, if any. */ -static tree *dummy_node_table; +static GTY((length ("max_gnat_nodes"))) tree * dummy_node_table; /* Initialize the above table. */ @@ -4049,8 +4053,7 @@ init_dummy_type () { Node_Id gnat_node; - dummy_node_table = (tree *) xmalloc (max_gnat_nodes * sizeof (tree)); - ggc_add_tree_root (dummy_node_table, max_gnat_nodes); + dummy_node_table = (tree *) ggc_alloc (max_gnat_nodes * sizeof (tree)); for (gnat_node = 0; gnat_node < max_gnat_nodes; gnat_node++) dummy_node_table[gnat_node] = NULL_TREE; @@ -4447,9 +4450,9 @@ make_packable_type (type) ! DECL_NONADDRESSABLE_P (old_field)); DECL_INTERNAL_P (new_field) = DECL_INTERNAL_P (old_field); - DECL_ORIGINAL_FIELD (new_field) - = (DECL_ORIGINAL_FIELD (old_field) != 0 - ? DECL_ORIGINAL_FIELD (old_field) : old_field); + SET_DECL_ORIGINAL_FIELD (new_field, + (DECL_ORIGINAL_FIELD (old_field) != 0 + ? DECL_ORIGINAL_FIELD (old_field) : old_field)); TREE_CHAIN (new_field) = field_list; field_list = new_field; } @@ -4583,7 +4586,7 @@ maybe_pad_type (type, size, align, gnat_entity, name_trailer, /* Keep the RM_Size of the padded record as that of the old record if requested. */ - TYPE_ADA_SIZE (record) = same_rm_size ? size : rm_size (type); + SET_TYPE_ADA_SIZE (record, same_rm_size ? size : rm_size (type)); /* Unless debugging information isn't being written for the input type, write a record that shows what we are a subtype of and also make a @@ -5696,12 +5699,12 @@ set_rm_size (uint_size, gnu_type, gnat_entity) && Is_Discrete_Or_Fixed_Point_Type (gnat_entity)) TYPE_RM_SIZE_INT (gnu_type) = size; else if (TREE_CODE (gnu_type) == ENUMERAL_TYPE) - TYPE_RM_SIZE_ENUM (gnu_type) = size; + SET_TYPE_RM_SIZE_ENUM (gnu_type, size); else if ((TREE_CODE (gnu_type) == RECORD_TYPE || TREE_CODE (gnu_type) == UNION_TYPE || TREE_CODE (gnu_type) == QUAL_UNION_TYPE) && ! TYPE_IS_FAT_POINTER_P (gnu_type)) - TYPE_ADA_SIZE (gnu_type) = size; + SET_TYPE_ADA_SIZE (gnu_type, size); } /* Given a type TYPE, return a new type whose size is appropriate for SIZE. @@ -5935,8 +5938,8 @@ gnat_substitute_in_type (t, f, r) new = build_range_type (TREE_TYPE (t), low, high); if (TYPE_INDEX_TYPE (t)) - TYPE_INDEX_TYPE (new) - = gnat_substitute_in_type (TYPE_INDEX_TYPE (t), f, r); + SET_TYPE_INDEX_TYPE (new, + gnat_substitute_in_type (TYPE_INDEX_TYPE (t), f, r)); return new; } @@ -6056,9 +6059,9 @@ gnat_substitute_in_type (t, f, r) } DECL_CONTEXT (new_field) = new; - DECL_ORIGINAL_FIELD (new_field) - = DECL_ORIGINAL_FIELD (field) != 0 - ? DECL_ORIGINAL_FIELD (field) : field; + SET_DECL_ORIGINAL_FIELD (new_field, + (DECL_ORIGINAL_FIELD (field) != 0 + ? DECL_ORIGINAL_FIELD (field) : field)); /* If the size of the old field was set at a constant, propagate the size in case the type's size was variable. @@ -6121,7 +6124,7 @@ gnat_substitute_in_type (t, f, r) { TYPE_SIZE (new) = TYPE_SIZE (t); TYPE_SIZE_UNIT (new) = TYPE_SIZE_UNIT (t); - TYPE_ADA_SIZE (new) = TYPE_ADA_SIZE (t); + SET_TYPE_ADA_SIZE (new, TYPE_ADA_SIZE (t)); } return new; @@ -6209,3 +6212,5 @@ concat_id_with_name (gnu_id, suffix) strcpy (Name_Buffer + len, suffix); return get_identifier (Name_Buffer); } + +#include "gt-ada-decl.h" diff --git a/gcc/ada/gigi.h b/gcc/ada/gigi.h index 44b5937d7c1..586b1fee9cf 100644 --- a/gcc/ada/gigi.h +++ b/gcc/ada/gigi.h @@ -159,7 +159,7 @@ extern const char *ref_filename; /* List of TREE_LIST nodes representing a block stack. TREE_VALUE of each gives the variable used for the setjmp buffer in the current block, if any. */ -extern tree gnu_block_stack; +extern GTY(()) tree gnu_block_stack; /* This is the main program of the back-end. It sets up all the table structures and then generates code. */ @@ -348,8 +348,8 @@ enum standard_datatypes ADT_raise_nodefer_decl, ADT_LAST}; -extern tree gnat_std_decls[(int) ADT_LAST]; -extern tree gnat_raise_decls[(int) LAST_REASON_CODE + 1]; +extern GTY(()) tree gnat_std_decls[(int) ADT_LAST]; +extern GTY(()) tree gnat_raise_decls[(int) LAST_REASON_CODE + 1]; #define longest_float_type_node gnat_std_decls[(int) ADT_longest_float_type] #define void_type_decl_node gnat_std_decls[(int) ADT_void_type_decl] diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi index b80f66683b6..d1df13cc409 100644 --- a/gcc/ada/gnat_rm.texi +++ b/gcc/ada/gnat_rm.texi @@ -8,7 +8,7 @@ @c o @c G N A T _ RM o @c o -@c $Revision: 1.6 $ +@c $Revision: 1.3.8.1 $ @c o @c Copyright (C) 1995-2002 Free Software Foundation o @c o diff --git a/gcc/ada/misc.c b/gcc/ada/misc.c index 3bc01d303aa..a03a216d78d 100644 --- a/gcc/ada/misc.c +++ b/gcc/ada/misc.c @@ -86,7 +86,6 @@ static const char *gnat_printable_name PARAMS ((tree, int)); static tree gnat_eh_runtime_type PARAMS ((tree)); static int gnat_eh_type_covers PARAMS ((tree, tree)); static void gnat_parse_file PARAMS ((int)); -static void gnat_mark_tree PARAMS ((tree)); static rtx gnat_expand_expr PARAMS ((tree, rtx, enum machine_mode, int)); @@ -104,8 +103,6 @@ static rtx gnat_expand_expr PARAMS ((tree, rtx, enum machine_mode, #define LANG_HOOKS_DECODE_OPTION gnat_decode_option #undef LANG_HOOKS_PARSE_FILE #define LANG_HOOKS_PARSE_FILE gnat_parse_file -#undef LANG_HOOKS_MARK_TREE -#define LANG_HOOKS_MARK_TREE gnat_mark_tree #undef LANG_HOOKS_HONOR_READONLY #define LANG_HOOKS_HONOR_READONLY 1 #undef LANG_HOOKS_FINISH_INCOMPLETE_DECL @@ -289,53 +286,6 @@ gnat_init_options () gnat_argc = 1; } -static void -gnat_mark_tree (t) - tree t; -{ - switch (TREE_CODE (t)) - { - case FUNCTION_TYPE: - ggc_mark_tree (TYPE_CI_CO_LIST (t)); - return; - - case INTEGER_TYPE: - if (TYPE_MODULAR_P (t)) - ggc_mark_tree (TYPE_MODULUS (t)); - else if (TYPE_VAX_FLOATING_POINT_P (t)) - ; - else if (TYPE_HAS_ACTUAL_BOUNDS_P (t)) - ggc_mark_tree (TYPE_ACTUAL_BOUNDS (t)); - else - ggc_mark_tree (TYPE_INDEX_TYPE (t)); - return; - - case ENUMERAL_TYPE: - ggc_mark_tree (TYPE_RM_SIZE_ENUM (t)); - return; - - case ARRAY_TYPE: - ggc_mark_tree (TYPE_ACTUAL_BOUNDS (t)); - return; - - case RECORD_TYPE: case UNION_TYPE: case QUAL_UNION_TYPE: - /* This is really TYPE_UNCONSTRAINED_ARRAY for fat pointers. */ - ggc_mark_tree (TYPE_ADA_SIZE (t)); - return; - - case CONST_DECL: - ggc_mark_tree (DECL_CONST_CORRESPONDING_VAR (t)); - return; - - case FIELD_DECL: - ggc_mark_tree (DECL_ORIGINAL_FIELD (t)); - return; - - default: - return; - } -} - /* Here is the function to handle the compiler error processing in GCC. */ static void diff --git a/gcc/ada/prj-makr.adb b/gcc/ada/prj-makr.adb index b74b5664d49..4cb9f02dc54 100644 --- a/gcc/ada/prj-makr.adb +++ b/gcc/ada/prj-makr.adb @@ -6,7 +6,6 @@ -- -- -- B o d y -- -- -- --- $Revision$ -- -- -- Copyright (C) 2001-2002 Free Software Foundation, Inc. -- -- -- diff --git a/gcc/ada/prj-makr.ads b/gcc/ada/prj-makr.ads index 4bba35c6cc3..7d0279858c8 100644 --- a/gcc/ada/prj-makr.ads +++ b/gcc/ada/prj-makr.ads @@ -6,7 +6,6 @@ -- -- -- S p e c -- -- -- --- $Revision$ -- -- -- Copyright (C) 2001-2002 Free Software Foundation, Inc. -- -- -- diff --git a/gcc/ada/prj-pp.adb b/gcc/ada/prj-pp.adb index 707417b0e0f..143eefa8d88 100644 --- a/gcc/ada/prj-pp.adb +++ b/gcc/ada/prj-pp.adb @@ -6,7 +6,6 @@ -- -- -- B o d y -- -- -- --- $Revision$ -- -- -- Copyright (C) 2001-2002 Free Software Foundation, Inc. -- -- -- diff --git a/gcc/ada/prj-pp.ads b/gcc/ada/prj-pp.ads index b70ff472624..ef859cf674b 100644 --- a/gcc/ada/prj-pp.ads +++ b/gcc/ada/prj-pp.ads @@ -6,7 +6,6 @@ -- -- -- S p e c -- -- -- --- $Revision$ -- -- -- Copyright (C) 2001 Free Software Foundation, Inc. -- -- -- diff --git a/gcc/ada/trans.c b/gcc/ada/trans.c index 63aafe4a62e..2fafd48de8e 100644 --- a/gcc/ada/trans.c +++ b/gcc/ada/trans.c @@ -86,7 +86,7 @@ tree gnu_block_stack; variables. TREE_VALUE is the VAR_DECL that stores the address of the raised exception. Nonzero means we are in an exception handler. Not used in the zero-cost case. */ -static tree gnu_except_ptr_stack; +static GTY(()) tree gnu_except_ptr_stack; /* Map GNAT tree codes to GCC tree codes for simple expressions. */ static enum tree_code gnu_codes[Number_Node_Kinds]; @@ -96,7 +96,7 @@ Node_Id error_gnat_node; /* Variable that stores a list of labels to be used as a goto target instead of a return in some functions. See processing for N_Subprogram_Body. */ -static tree gnu_return_label_stack; +static GTY(()) tree gnu_return_label_stack; static tree tree_transform PARAMS((Node_Id)); static void elaborate_all_entities PARAMS((Node_Id)); @@ -188,9 +188,6 @@ gigi (gnat_root, max_gnat_node, number_name, nodes_ptr, next_node_ptr, save_gnu_tree (Base_Type (standard_integer), TYPE_NAME (integer_type_node), 0); - ggc_add_tree_root (&gnu_block_stack, 1); - ggc_add_tree_root (&gnu_except_ptr_stack, 1); - ggc_add_tree_root (&gnu_return_label_stack, 1); gnu_except_ptr_stack = tree_cons (NULL_TREE, NULL_TREE, NULL_TREE); dconstp5 = REAL_VALUE_ATOF ("0.5", DFmode); @@ -2318,7 +2315,7 @@ tree_transform (gnat_node) { tree gnu_loop_id = make_node (GNAT_LOOP_ID); - TREE_LOOP_ID (gnu_loop_id) = (rtx) loop_id; + TREE_LOOP_ID (gnu_loop_id) = loop_id; save_gnu_tree (Entity (Identifier (gnat_node)), gnu_loop_id, 1); } @@ -2407,8 +2404,7 @@ tree_transform (gnat_node) if (Present (Name (gnat_node))) loop_id - = (struct nesting *) - TREE_LOOP_ID (get_gnu_tree (Entity (Name (gnat_node)))); + = TREE_LOOP_ID (get_gnu_tree (Entity (Name (gnat_node)))); if (Present (Condition (gnat_node))) gnu_cond = invert_truthvalue (gnat_truthvalue_conversion @@ -5589,3 +5585,5 @@ init_code_table () gnu_codes[N_Op_Shift_Right] = RSHIFT_EXPR; gnu_codes[N_Op_Shift_Right_Arithmetic] = RSHIFT_EXPR; } + +#include "gt-ada-trans.h" diff --git a/gcc/ada/utils.c b/gcc/ada/utils.c index 292efd33650..11cee7568d4 100644 --- a/gcc/ada/utils.c +++ b/gcc/ada/utils.c @@ -33,6 +33,7 @@ #include "toplev.h" #include "output.h" #include "ggc.h" +#include "debug.h" #include "convert.h" #include "ada.h" @@ -69,18 +70,22 @@ tree gnat_raise_decls[(int) LAST_REASON_CODE + 1]; /* Associates a GNAT tree node to a GCC tree node. It is used in `save_gnu_tree', `get_gnu_tree' and `present_gnu_tree'. See documentation of `save_gnu_tree' for more info. */ -static tree *associate_gnat_to_gnu; +static GTY((length ("max_gnat_nodes"))) tree *associate_gnat_to_gnu; /* This listhead is used to record any global objects that need elaboration. TREE_PURPOSE is the variable to be elaborated and TREE_VALUE is the initial value to assign. */ -static tree pending_elaborations; +static GTY(()) tree pending_elaborations; /* This stack allows us to momentarily switch to generating elaboration lists for an inner context. */ -static struct e_stack {struct e_stack *next; tree elab_list; } *elist_stack; +struct e_stack GTY(()) { + struct e_stack *next; + tree elab_list; +}; +static GTY(()) struct e_stack *elist_stack; /* This variable keeps a table for types for each precision so that we only allocate each of them once. Signed and unsigned types are kept separate. @@ -88,10 +93,10 @@ static struct e_stack {struct e_stack *next; tree elab_list; } *elist_stack; Note that these types are only used when fold-const requests something special. Perhaps we should NOT share these types; we'll see how it goes later. */ -static tree signed_and_unsigned_types[2 * MAX_BITS_PER_WORD + 1][2]; +static GTY(()) tree signed_and_unsigned_types[2 * MAX_BITS_PER_WORD + 1][2]; /* Likewise for float types, but record these by mode. */ -static tree float_types[NUM_MACHINE_MODES]; +static GTY(()) tree float_types[NUM_MACHINE_MODES]; /* For each binding contour we allocate a binding_level structure which records the entities defined or declared in that contour. Contours include: @@ -102,7 +107,7 @@ static tree float_types[NUM_MACHINE_MODES]; Binding contours are used to create GCC tree BLOCK nodes. */ -struct binding_level +struct binding_level GTY(()) { /* A chain of ..._DECL nodes for all variables, constants, functions, parameters and type declarations. These ..._DECL nodes are chained @@ -121,10 +126,10 @@ struct binding_level }; /* The binding level currently in effect. */ -static struct binding_level *current_binding_level = NULL; +static GTY(()) struct binding_level *current_binding_level; /* A chain of binding_level structures awaiting reuse. */ -static struct binding_level *free_binding_level = NULL; +static GTY((deletable (""))) struct binding_level *free_binding_level; /* The outermost binding level. This binding level is created when the compiler is started and it will exist through the entire compilation. */ @@ -133,6 +138,11 @@ static struct binding_level *global_binding_level; /* Binding level structures are initialized by copying this one. */ static struct binding_level clear_binding_level = {NULL, NULL, NULL, NULL}; +struct language_function GTY(()) +{ + int unused; +}; + static tree merge_sizes PARAMS ((tree, tree, tree, int, int)); static tree compute_related_constant PARAMS ((tree, tree)); static tree split_plus PARAMS ((tree, tree *)); @@ -142,8 +152,6 @@ static tree convert_to_fat_pointer PARAMS ((tree, tree)); static tree convert_to_thin_pointer PARAMS ((tree, tree)); static tree make_descriptor_field PARAMS ((const char *,tree, tree, tree)); -static void mark_binding_level PARAMS ((PTR)); -static void mark_e_stack PARAMS ((PTR)); /* Initialize the association of GNAT nodes to GCC trees. */ @@ -152,22 +160,12 @@ init_gnat_to_gnu () { Node_Id gnat_node; - associate_gnat_to_gnu = (tree *) xmalloc (max_gnat_nodes * sizeof (tree)); - ggc_add_tree_root (associate_gnat_to_gnu, max_gnat_nodes); + associate_gnat_to_gnu = (tree *) ggc_alloc (max_gnat_nodes * sizeof (tree)); for (gnat_node = 0; gnat_node < max_gnat_nodes; gnat_node++) associate_gnat_to_gnu[gnat_node] = NULL_TREE; pending_elaborations = build_tree_list (NULL_TREE, NULL_TREE); - ggc_add_tree_root (&pending_elaborations, 1); - ggc_add_root ((PTR) &elist_stack, 1, sizeof (struct e_stack), mark_e_stack); - ggc_add_tree_root (&signed_and_unsigned_types[0][0], - (sizeof signed_and_unsigned_types - / sizeof signed_and_unsigned_types[0][0])); - ggc_add_tree_root (float_types, ARRAY_SIZE (float_types)); - - ggc_add_root (¤t_binding_level, 1, sizeof current_binding_level, - mark_binding_level); } /* GNAT_ENTITY is a GNAT tree node for an entity. GNU_DECL is the GCC tree @@ -260,7 +258,7 @@ pushlevel (ignore) } else newlevel - = (struct binding_level *) xmalloc (sizeof (struct binding_level)); + = (struct binding_level *) ggc_alloc (sizeof (struct binding_level)); *newlevel = clear_binding_level; @@ -680,9 +678,6 @@ init_gigi_decls (long_long_float_type, exception_type) DECL_FUNCTION_CODE (setjmp_decl) = BUILT_IN_SETJMP; main_identifier_node = get_identifier ("main"); - - ggc_add_tree_root (gnat_std_decls, ARRAY_SIZE (gnat_std_decls)); - ggc_add_tree_root (gnat_raise_decls, ARRAY_SIZE (gnat_raise_decls)); } /* This function is called indirectly from toplev.c to handle incomplete @@ -849,7 +844,7 @@ finish_record_type (record_type, fieldlist, has_rep, defer_debug) /* Now set any of the values we've just computed that apply. */ if (! TYPE_IS_FAT_POINTER_P (record_type) && ! TYPE_CONTAINS_TEMPLATE_P (record_type)) - TYPE_ADA_SIZE (record_type) = ada_size; + SET_TYPE_ADA_SIZE (record_type, ada_size); #ifdef ROUND_TYPE_SIZE size = ROUND_TYPE_SIZE (record_type, size, TYPE_ALIGN (record_type)); @@ -1159,7 +1154,7 @@ create_subprog_type (return_type, param_decl_list, cico_list, || TYPE_RETURNS_BY_REF_P (type) != returns_by_ref) type = copy_type (type); - TYPE_CI_CO_LIST (type) = cico_list; + SET_TYPE_CI_CO_LIST (type, cico_list); TYPE_RETURNS_UNCONSTRAINED_P (type) = returns_unconstrained; TYPE_RETURNS_STACK_DEPRESSED (type) = returns_with_dsp; TYPE_RETURNS_BY_REF_P (type) = returns_by_ref; @@ -1207,7 +1202,7 @@ create_index_type (min, max, index) else if (TYPE_INDEX_TYPE (type) != 0) type = copy_type (type); - TYPE_INDEX_TYPE (type) = index; + SET_TYPE_INDEX_TYPE (type, index); return type; } @@ -1598,37 +1593,6 @@ get_pending_elaborations () return result; } -/* Mark the binding level stack. */ - -static void -mark_binding_level (arg) - PTR arg; -{ - struct binding_level *level = *(struct binding_level **) arg; - - for (; level != 0; level = level->level_chain) - { - ggc_mark_tree (level->names); - ggc_mark_tree (level->blocks); - ggc_mark_tree (level->this_block); - } -} - -/* Mark the pending elaboration list. */ - -static void -mark_e_stack (data) - PTR data; -{ - struct e_stack *p = *((struct e_stack **) data); - - if (p != 0) - { - ggc_mark_tree (p->elab_list); - mark_e_stack (&p->next); - } -} - /* Return nonzero if there are pending elaborations. */ int @@ -1643,7 +1607,7 @@ pending_elaborations_p () void push_pending_elaborations () { - struct e_stack *p = (struct e_stack *) xmalloc (sizeof (struct e_stack)); + struct e_stack *p = (struct e_stack *) ggc_alloc (sizeof (struct e_stack)); p->next = elist_stack; p->elab_list = pending_elaborations; @@ -1660,7 +1624,6 @@ pop_pending_elaborations () pending_elaborations = p->elab_list; elist_stack = p->next; - free (p); } /* Return the current position in pending_elaborations so we can insert @@ -2666,7 +2629,7 @@ update_pointer_to (old_type, new_type) TREE_CHAIN (TYPE_FIELDS (ptr)), new_ref)); for (var = TYPE_MAIN_VARIANT (ptr); var; var = TYPE_NEXT_VARIANT (var)) - TYPE_UNCONSTRAINED_ARRAY (var) = new_type; + SET_TYPE_UNCONSTRAINED_ARRAY (var, new_type); TYPE_POINTER_TO (new_type) = TYPE_REFERENCE_TO (new_type) = TREE_TYPE (new_type) = ptr; @@ -3366,3 +3329,6 @@ unchecked_convert (type, expr) return expr; } + +#include "gt-ada-utils.h" +#include "gtype-ada.h" diff --git a/gcc/ada/utils2.c b/gcc/ada/utils2.c index 6d76a4149ce..e3627a28e5e 100644 --- a/gcc/ada/utils2.c +++ b/gcc/ada/utils2.c @@ -514,7 +514,7 @@ nonbinary_modular_operation (op_code, type, lhs, rhs) /* Copy the node so we ensure it can be modified to make it modular. */ op_type = copy_node (gnat_type_for_size (precision, unsignedp)); modulus = convert (op_type, modulus); - TYPE_MODULUS (op_type) = modulus; + SET_TYPE_MODULUS (op_type, modulus); TYPE_MODULAR_P (op_type) = 1; lhs = convert (op_type, lhs); rhs = convert (op_type, rhs); @@ -530,7 +530,7 @@ nonbinary_modular_operation (op_code, type, lhs, rhs) { tree div_type = copy_node (gnat_type_for_size (needed_precision, 1)); modulus = convert (div_type, modulus); - TYPE_MODULUS (div_type) = modulus; + SET_TYPE_MODULUS (div_type, modulus); TYPE_MODULAR_P (div_type) = 1; result = convert (op_type, fold (build (TRUNC_MOD_EXPR, div_type, |