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/utils.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/utils.c')
-rw-r--r-- | gcc/ada/utils.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/gcc/ada/utils.c b/gcc/ada/utils.c index e09c83e..08c0819 100644 --- a/gcc/ada/utils.c +++ b/gcc/ada/utils.c @@ -2092,7 +2092,7 @@ build_template (tree template_type, tree array_type, tree expr) if (TREE_CODE (array_type) == RECORD_TYPE && (TYPE_IS_PADDING_P (array_type) - || TYPE_LEFT_JUSTIFIED_MODULAR_P (array_type))) + || TYPE_JUSTIFIED_MODULAR_P (array_type))) array_type = TREE_TYPE (TYPE_FIELDS (array_type)); if (TREE_CODE (array_type) == ARRAY_TYPE @@ -2801,10 +2801,10 @@ convert (tree type, tree expr) expr)), TYPE_MIN_VALUE (etype)))); - /* If the input is a left-justified modular type, we need to extract + /* If the input is a justified modular type, we need to extract the actual object before converting it to any other type with the exception of an unconstrained array. */ - if (ecode == RECORD_TYPE && TYPE_LEFT_JUSTIFIED_MODULAR_P (etype) + if (ecode == RECORD_TYPE && TYPE_JUSTIFIED_MODULAR_P (etype) && code != UNCONSTRAINED_ARRAY_TYPE) return convert (type, build_component_ref (expr, NULL_TREE, TYPE_FIELDS (etype), false)); @@ -2979,7 +2979,7 @@ convert (tree type, tree expr) return fold (convert_to_real (type, expr)); case RECORD_TYPE: - if (TYPE_LEFT_JUSTIFIED_MODULAR_P (type) && !AGGREGATE_TYPE_P (etype)) + if (TYPE_JUSTIFIED_MODULAR_P (type) && !AGGREGATE_TYPE_P (etype)) return gnat_build_constructor (type, tree_cons (TYPE_FIELDS (type), @@ -3002,7 +3002,7 @@ convert (tree type, tree expr) if (TREE_TYPE (tem) == etype) return build1 (CONVERT_EXPR, type, expr); else if (TREE_CODE (TREE_TYPE (tem)) == RECORD_TYPE - && (TYPE_LEFT_JUSTIFIED_MODULAR_P (TREE_TYPE (tem)) + && (TYPE_JUSTIFIED_MODULAR_P (TREE_TYPE (tem)) || TYPE_IS_PADDING_P (TREE_TYPE (tem))) && TREE_TYPE (TYPE_FIELDS (TREE_TYPE (tem))) == etype) return build1 (CONVERT_EXPR, type, @@ -3015,12 +3015,12 @@ convert (tree type, tree expr) /* If EXPR is a constrained array, take its address, convert it to a fat pointer, and then dereference it. Likewise if EXPR is a record containing both a template and a constrained array. - Note that a record representing a left justified modular type + Note that a record representing a justified modular type always represents a packed constrained array. */ if (ecode == ARRAY_TYPE || (ecode == INTEGER_TYPE && TYPE_HAS_ACTUAL_BOUNDS_P (etype)) || (ecode == RECORD_TYPE && TYPE_CONTAINS_TEMPLATE_P (etype)) - || (ecode == RECORD_TYPE && TYPE_LEFT_JUSTIFIED_MODULAR_P (etype))) + || (ecode == RECORD_TYPE && TYPE_JUSTIFIED_MODULAR_P (etype))) return build_unary_op (INDIRECT_REF, NULL_TREE, @@ -3048,7 +3048,7 @@ convert (tree type, tree expr) } /* Remove all conversions that are done in EXP. This includes converting - from a padded type or to a left-justified modular type. If TRUE_ADDRESS + from a padded type or to a justified modular type. If TRUE_ADDRESS is true, always return the address of the containing object even if the address is not bit-aligned. */ @@ -3060,7 +3060,7 @@ remove_conversions (tree exp, bool true_address) case CONSTRUCTOR: if (true_address && TREE_CODE (TREE_TYPE (exp)) == RECORD_TYPE - && TYPE_LEFT_JUSTIFIED_MODULAR_P (TREE_TYPE (exp))) + && TYPE_JUSTIFIED_MODULAR_P (TREE_TYPE (exp))) return remove_conversions (TREE_VALUE (CONSTRUCTOR_ELTS (exp)), true); break; @@ -3156,13 +3156,13 @@ unchecked_convert (tree type, tree expr, bool notrunc_p) && TYPE_VAX_FLOATING_POINT_P (type))) || (POINTER_TYPE_P (type) && ! TYPE_THIN_POINTER_P (type)) || (TREE_CODE (type) == RECORD_TYPE - && TYPE_LEFT_JUSTIFIED_MODULAR_P (type))) + && TYPE_JUSTIFIED_MODULAR_P (type))) && ((INTEGRAL_TYPE_P (etype) && !(TREE_CODE (etype) == INTEGER_TYPE && TYPE_VAX_FLOATING_POINT_P (etype))) || (POINTER_TYPE_P (etype) && !TYPE_THIN_POINTER_P (etype)) || (TREE_CODE (etype) == RECORD_TYPE - && TYPE_LEFT_JUSTIFIED_MODULAR_P (etype)))) + && TYPE_JUSTIFIED_MODULAR_P (etype)))) || TREE_CODE (type) == UNCONSTRAINED_ARRAY_TYPE) { tree rtype = type; |