]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fix regression with partial rep clause on variant record type
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 3 Feb 2021 10:38:04 +0000 (11:38 +0100)
committerEric Botcazou <ebotcazou@adacore.com>
Wed, 3 Feb 2021 10:40:32 +0000 (11:40 +0100)
commit46de8a148b054a34c342b6e0050c78e80e2d7055
tree165f19aff5de116a88331c5940634dfef201c78c
parentf288c7d811400fc8960f9c1576f0488b6bfe952b
Fix regression with partial rep clause on variant record type

It can yield an incorrect layout when there is a partial representation
clause on a discriminated record type with a variant part.

gcc/ada/
* gcc-interface/decl.c (components_to_record): If the first component
with rep clause is the _Parent field with variable size, temporarily
set it aside when computing the internal layout of the REP part again.
* gcc-interface/utils.c (finish_record_type): Revert to taking the
maximum when merging sizes for all record types with rep clause.
(merge_sizes): Put SPECIAL parameter last and adjust recursive calls.
gcc/ada/gcc-interface/decl.c
gcc/ada/gcc-interface/utils.c