[Ada] Disable DECL_BIT_FIELD_REPRESENTATIVE machinery in some cases

Eric Botcazou ebotcazou@adacore.com
Thu Nov 8 15:19:00 GMT 2018


We can have quite convoluted layouts in Ada when a representation clause is 
given for a record type with variant part and this doesn't always play nice 
with the DECL_BIT_FIELD_REPRESENTATIVE machinery.  This patch arranges for 
DECL_BIT_FIELD_TYPE to be cleared on the variant part in these cases.

Tested on x86_64-suse-linux, applied on the mainline.


2018-11-08  Eric Botcazou  <ebotcazou@adacore.com>

	* gcc-interface/decl.c (components_to_record): Remove obsolete kludge.
	* gcc-interface/utils.c (make_packable_type): Set TYPE_PACKED on the
	new type but do not take into account the setting on the old type for
	the new fields.  Rename a local variable.
	(finish_record_type): Clear DECL_BIT_FIELD_TYPE on a variant part at
	offset 0, if any.
	(create_field_decl): Tweak comment.

-- 
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.diff
Type: text/x-patch
Size: 4817 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20181108/662882ef/attachment.bin>


More information about the Gcc-patches mailing list