From: Eric Botcazou <ebotca...@adacore.com> The size needs to be rounded up to the storage unit in all cases.
gcc/ada/ * gcc-interface/utils.cc (finish_record_type): Round the size in the padding case as well. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/gcc-interface/utils.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ada/gcc-interface/utils.cc b/gcc/ada/gcc-interface/utils.cc index d0a13d2af33..f720f3a3b4a 100644 --- a/gcc/ada/gcc-interface/utils.cc +++ b/gcc/ada/gcc-interface/utils.cc @@ -2159,7 +2159,7 @@ finish_record_type (tree record_type, tree field_list, int rep_level, /* If this is a padding record, we never want to make the size smaller than what was specified in it, if any. */ if (TYPE_IS_PADDING_P (record_type) && had_size) - size = TYPE_SIZE (record_type); + size = round_up (TYPE_SIZE (record_type), BITS_PER_UNIT); else size = round_up (size, BITS_PER_UNIT); -- 2.40.0