[Ada] Fix regression with partial rep clause on variant record type
Eric Botcazou
botcazou@adacore.com
Wed Feb 3 10:41:35 GMT 2021
It is present on the mainline, 10 and 9 branches, and can yield an incorrect
layout when there is a partial representation clause on a discriminated record
type with a variant part.
Tested on x86-64/Linux, applied on mainline, 10 and 9 branches.
2021-02-03 Eric Botcazou <ebotcazou@adacore.com>
* 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.
--
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.diff
Type: text/x-patch
Size: 9585 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20210203/4b6005d9/attachment.bin>
More information about the Gcc-patches
mailing list