This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PCH] Fix some Ada problems
- From: Geoffrey Keating <geoffk at romulus dot sfbay dot redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 30 May 2002 23:09:11 -0700
- Subject: [PCH] Fix some Ada problems
I finally managed to get an Ada compiler that I could use reliably,
and after fixing the bugs Andreas reported I found some more bugs.
Bootstrapped (with some other patches) on i686-pc-linux-gnu with gcac
checking.
--
Geoff Keating <geoffk@redhat.com>
===File ~/patches/pchbranch-adafixes2.patch=================
Index: ChangeLog
2002-05-30 Geoffrey Keating <geoffk@redhat.com>
* 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.
Index: ada-tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ada/ada-tree.h,v
retrieving revision 1.1.14.3
diff -p -u -p -r1.1.14.3 ada-tree.h
--- ada-tree.h 8 May 2002 22:38:20 -0000 1.1.14.3
+++ ada-tree.h 31 May 2002 06:08:28 -0000
@@ -159,21 +159,29 @@ struct lang_type GTY(())
cico parameter passing mechanism refer to the routine gnat_to_gnu_entity. */
#define TYPE_CI_CO_LIST(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) \
(&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) \
(&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))->t.generic)
+ ((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))
@@ -181,6 +189,8 @@ struct lang_type GTY(())
/* Likewise for ENUMERAL_TYPE. */
#define TYPE_RM_SIZE_ENUM(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) \
@@ -192,16 +202,22 @@ struct lang_type GTY(())
to by a thin pointer. */
#define TYPE_UNCONSTRAINED_ARRAY(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) (&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) (&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. */
@@ -241,11 +257,15 @@ struct lang_type GTY(())
address taken. */
#define DECL_CONST_CORRESPONDING_VAR(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) \
(&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. */
@@ -254,4 +274,4 @@ struct lang_type GTY(())
/* 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) \
- (((union tree_lang_node *)TREE_CHECK (NODE, GNAT_LOOP_ID))->loop_id.loop_id)
+ (((union lang_tree_node *)TREE_CHECK (NODE, GNAT_LOOP_ID))->loop_id.loop_id)
Index: config-lang.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ada/config-lang.in,v
retrieving revision 1.4.8.2
diff -p -u -p -r1.4.8.2 config-lang.in
--- config-lang.in 9 Apr 2002 21:56:32 -0000 1.4.8.2
+++ config-lang.in 31 May 2002 06:08:28 -0000
@@ -35,7 +35,7 @@ compilers="gnat1\$(exeext)"
stagestuff="gnatbind\$(exeext) gnat1\$(exeext)"
-gtfiles="\$(srcdir)/ada/gigi.h \$(srcdir)/ada/decl.c \$(srcdir)/ada/trans.c \$(srcdir)/ada/utils.c"
+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"
Index: decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ada/decl.c,v
retrieving revision 1.9.8.3
diff -p -u -p -r1.9.8.3 decl.c
--- decl.c 6 May 2002 18:47:08 -0000 1.9.8.3
+++ decl.c 31 May 2002 06:08:28 -0000
@@ -1044,10 +1044,10 @@ gnat_to_gnu_entity (gnat_entity, gnu_exp
|| 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_exp
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_exp
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_exp
{
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_exp
= 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_exp
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_exp
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_exp
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_exp
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_exp
&& 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_exp
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_exp
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_exp
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));
}
}
@@ -4446,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;
}
@@ -4582,7 +4586,7 @@ maybe_pad_type (type, size, align, gnat_
/* 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
@@ -5695,12 +5699,12 @@ set_rm_size (uint_size, gnu_type, gnat_e
&& 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.
@@ -5934,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;
}
@@ -6055,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.
@@ -6120,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;
Index: utils.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ada/utils.c,v
retrieving revision 1.8.6.6
diff -p -u -p -r1.8.6.6 utils.c
--- utils.c 20 May 2002 22:34:22 -0000 1.8.6.6
+++ utils.c 31 May 2002 06:08:30 -0000
@@ -33,6 +33,7 @@
#include "toplev.h"
#include "output.h"
#include "ggc.h"
+#include "debug.h"
#include "convert.h"
#include "ada.h"
@@ -843,7 +844,7 @@ finish_record_type (record_type, fieldli
/* 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));
@@ -1153,7 +1154,7 @@ create_subprog_type (return_type, param_
|| 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;
@@ -1201,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;
}
@@ -2628,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;
Index: utils2.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ada/utils2.c,v
retrieving revision 1.4.8.2
diff -p -u -p -r1.4.8.2 utils2.c
--- utils2.c 6 May 2002 18:49:40 -0000 1.4.8.2
+++ utils2.c 31 May 2002 06:08:30 -0000
@@ -514,7 +514,7 @@ nonbinary_modular_operation (op_code, ty
/* 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, ty
{
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,
============================================================