This is the Ada front-end (in fact gigi) part. ada/ * gcc-interface/gigi.h (set_reverse_storage_order_on_pad_type): Declare * gcc-interface/decl.c (gnat_to_gnu_entity) : Set the storage order on the enclosing record for a packed array type. : Set the storage order. : Likewise. : Likewise. : Likewise. (gnat_to_gnu_component_type): Set the reverse storage order on a padded type built for a non-bit-packed array. (gnat_to_gnu_field): Likewise. (components_to_record): Deal with TYPE_REVERSE_STORAGE_ORDER. * gcc-interface/utils.c (make_packable_type): Likewise. (pad_type_hasher::equal): Likewise. (gnat_types_compatible_p): Likewise. (unchecked_convert): Likewise. (set_reverse_storage_order_on_pad_type): New public function. * gcc-interface/trans.c (Attribute_to_gnu): Adjust call to get_inner_reference. * gcc-interface/utils2.c (build_unary_op): Likewise. (gnat_build_constructor): Deal with TYPE_REVERSE_STORAGE_ORDER. (gnat_rewrite_reference): Propagate the REF_REVERSE_STORAGE_ORDER flag. decl.c | 49 +++++++++++++++++++++++++++++++++--- gigi.h | 3 ++ trans.c | 4 +-- utils.c | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++---------- utils2.c | 15 +++++++---- 5 files changed, 131 insertions(+), 24 deletions(-) -- Eric Botcazou