[Ada] Fix for atomic wrongly rejected on object of discriminated type

Pierre-Marie de Rodat derodat@adacore.com
Mon Oct 11 13:39:56 GMT 2021


The reason is that the automatic alignment promotion is not yet performed
in the case where the nominal subtype is of variable size.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

	* gcc-interface/decl.c (promote_object_alignment): Add GNU_SIZE
	parameter and use it for the size of the object if not null.
	(gnat_to_gnu_entity) <E_Variable>: Perform the automatic alignment
	promotion for objects whose nominal subtype is of variable size.
	(gnat_to_gnu_field): Adjust call to promote_object_alignment.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 3642 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20211011/bbbaca93/attachment.bin>


More information about the Gcc-patches mailing list