expr.c (expand_expr_real_1): Apply the big-endian adjustment for bit-fields to all...
authorEric Botcazou <ebotcazou@adacore.com>
Sat, 29 Jun 2019 07:16:37 +0000 (07:16 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Sat, 29 Jun 2019 07:16:37 +0000 (07:16 +0000)
commitb1af4cb2903711183e62f922fc235d48c7a738bb
treee52fb1419869e176950e8aab90f65e8e32ade6ce
parent43e1e8b5b8ed9f0e4311c0974b9e459471a275b0
expr.c (expand_expr_real_1): Apply the big-endian adjustment for bit-fields to all aggregate types.

* expr.c (expand_expr_real_1) <BIT_FIELD_REF>: Apply the big-endian
adjustment for bit-fields to all aggregate types.
ada/
* gcc-interface/gigi.h (make_packable_type): Remove default value.
(value_factor_p): Tweak prototype.
* gcc-interface/decl.c (gnat_to_gnu_entity): Add comment.
(gnat_to_gnu_component_type): Likewise.
(gnat_to_gnu_field): Likewise.  Fetch the position of the field earlier
and simplify the condition under which the type is packed.  Declare
  local variable is_bitfield.  Pass 1 as max_align to make_packable_type
if it is set to true.
(copy_and_substitute_in_layout): Pass 0 to make_packable_type.
* gcc-interface/utils.c (make_packable_array_type): New function.
(make_packable_type): Use it to rewrite the type of array field.
(maybe_pad_type): Pass align parameter to make_packable_type.
(create_field_decl): Minor tweaks.
(value_factor_p): Assert that FACTOR is a power of 2 and replace the
modulo computation by a masking operation.

From-SVN: r272810
gcc/ChangeLog
gcc/ada/ChangeLog
gcc/ada/gcc-interface/decl.c
gcc/ada/gcc-interface/gigi.h
gcc/ada/gcc-interface/utils.c
gcc/expr.c
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/array35.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/array36.adb [new file with mode: 0644]