diff options
author | Robert Dewar <dewar@gnat.com> | 2004-09-21 15:31:03 +0000 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2004-09-21 17:31:03 +0200 |
commit | 910d20fcb8c5fa83c64c1540cca945cc0c31d77c (patch) | |
tree | 0f2f5fda62754d844de054ab5257854ecaf80e0f /gcc/ada/trans.c | |
parent | f1b1846249458e8b583b407f674fec541c4f6869 (diff) | |
download | gcc-910d20fcb8c5fa83c64c1540cca945cc0c31d77c.zip gcc-910d20fcb8c5fa83c64c1540cca945cc0c31d77c.tar.gz gcc-910d20fcb8c5fa83c64c1540cca945cc0c31d77c.tar.bz2 |
decl.c (gnat_to_gnu_type, [...]): Wrap modular packed array types in both little- and big-endian cases.
2004-09-21 Robert Dewar <dewar@gnat.com>
* decl.c (gnat_to_gnu_type, case E_Modular_Integer_Type): Wrap modular
packed array types in both little- and big-endian cases. This change
ensures that we no longer count on the unused bits being initialized
for such types (and in particular ensures that equality testing will
only read the relevant bits).
Change name TYPE_LEFT_JUSTIFIED_MODULAR_P to TYPE_JUSTIFIED_MODULAR_P
These changes mean that we no longer need to initialize small packed
arrays.
(gnat_to_gnu_entity) <E_Record_Subtype>: Apply the same
optimization to an LJM field as to its parent field.
* ada-tree.h:, trans.c, utils.c, utils2.c:
Change name TYPE_LEFT_JUSTIFIED_MODULAR_P to TYPE_JUSTIFIED_MODULAR_P
From-SVN: r87806
Diffstat (limited to 'gcc/ada/trans.c')
-rw-r--r-- | gcc/ada/trans.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/gcc/ada/trans.c b/gcc/ada/trans.c index 4defe55..1085b06 100644 --- a/gcc/ada/trans.c +++ b/gcc/ada/trans.c @@ -1606,7 +1606,7 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target) gnu_target, false)), NULL_TREE); - + } /* The only way we can be making a call via an access type is if Name is an @@ -1668,7 +1668,7 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target) tree gnu_temp; /* Remove any unpadding on the actual and make a copy. But if - the actual is a left-justified modular type, first convert + the actual is a justified modular type, first convert to it. */ if (TREE_CODE (gnu_name) == COMPONENT_REF && ((TREE_CODE (TREE_TYPE (TREE_OPERAND (gnu_name, 0))) @@ -1677,7 +1677,7 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target) (TREE_TYPE (TREE_OPERAND (gnu_name, 0)))))) gnu_name = gnu_copy = TREE_OPERAND (gnu_name, 0); else if (TREE_CODE (gnu_name_type) == RECORD_TYPE - && (TYPE_LEFT_JUSTIFIED_MODULAR_P (gnu_name_type))) + && (TYPE_JUSTIFIED_MODULAR_P (gnu_name_type))) gnu_name = convert (gnu_name_type, gnu_name); gnu_actual = save_expr (gnu_name); @@ -1714,7 +1714,7 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target) if (Ekind (gnat_formal) != E_In_Parameter && TREE_CODE (gnu_name) == CONSTRUCTOR && TREE_CODE (TREE_TYPE (gnu_name)) == RECORD_TYPE - && TYPE_LEFT_JUSTIFIED_MODULAR_P (TREE_TYPE (gnu_name))) + && TYPE_JUSTIFIED_MODULAR_P (TREE_TYPE (gnu_name))) gnu_name = convert (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (gnu_name))), gnu_name); @@ -1829,7 +1829,7 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target) else { tree gnu_actual_size = TYPE_SIZE (TREE_TYPE (gnu_actual)); - + if (Ekind (gnat_formal) != E_In_Parameter) gnu_name_list = tree_cons (NULL_TREE, gnu_name, gnu_name_list); @@ -2083,7 +2083,6 @@ Handled_Sequence_Of_Statements_to_gnu (Node_Id gnat_node) build_unary_op (ADDR_EXPR, NULL_TREE, gnu_jmpbuf_decl))); - if (Present (First_Real_Statement (gnat_node))) process_decls (Statements (gnat_node), Empty, First_Real_Statement (gnat_node), true, true); @@ -2521,11 +2520,11 @@ gnat_to_gnu (Node_Id gnat_node) tree gnu_type; /* Get the type of the result, looking inside any padding and - left-justified modular types. Then get the value in that type. */ + justified modular types. Then get the value in that type. */ gnu_type = gnu_result_type = get_unpadded_type (Etype (gnat_node)); if (TREE_CODE (gnu_type) == RECORD_TYPE - && TYPE_LEFT_JUSTIFIED_MODULAR_P (gnu_type)) + && TYPE_JUSTIFIED_MODULAR_P (gnu_type)) gnu_type = TREE_TYPE (TYPE_FIELDS (gnu_type)); gnu_result = UI_To_gnu (Intval (gnat_node), gnu_type); @@ -4102,7 +4101,7 @@ gnat_to_gnu (Node_Id gnat_node) && (CONTAINS_PLACEHOLDER_P (TYPE_SIZE (TREE_TYPE (gnu_result)))))) && !(TREE_CODE (gnu_result_type) == RECORD_TYPE - && TYPE_LEFT_JUSTIFIED_MODULAR_P (gnu_result_type)))) + && TYPE_JUSTIFIED_MODULAR_P (gnu_result_type)))) { /* In this case remove padding only if the inner object is of self-referential size: in that case it must be an object of @@ -4521,7 +4520,7 @@ gnat_gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p ATTRIBUTE_UNUSED) return GS_ALL_DONE; } return GS_UNHANDLED; - + case COMPONENT_REF: /* We have a kludge here. If the FIELD_DECL is from a fat pointer and is from an early dummy type, replace it with the proper FIELD_DECL. */ @@ -5062,7 +5061,7 @@ emit_index_check (tree gnu_array_object, /* GNU_COND contains the condition corresponding to an access, discriminant or range check of value GNU_EXPR. Build a COND_EXPR that returns GNU_EXPR if - GNU_COND is false and raises a CONSTRAINT_ERROR if GNU_COND is true. + GNU_COND is false and raises a CONSTRAINT_ERROR if GNU_COND is true. REASON is the code that says why the exception was raised. */ static tree |