]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Fix minor glitch in finish_record_type
authorEric Botcazou <ebotcazou@adacore.com>
Thu, 7 Sep 2023 08:47:31 +0000 (10:47 +0200)
committerEric Botcazou <ebotcazou@adacore.com>
Wed, 27 Sep 2023 08:16:30 +0000 (10:16 +0200)
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.

gcc/ada/gcc-interface/utils.cc

index 392ec0b7f4eacf3aabeab9fe26cf6e9df0bb04a1..be91a9d562eee9f6fb96715fec2529705a1e770e 100644 (file)
@@ -2155,7 +2155,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);