[PATCH] Fix bug and pessimization for packed records in Ada

Eric Botcazou ebotcazou@adacore.com
Tue Dec 7 08:50:00 GMT 2004


> 2004-11-18  Eric Botcazou  <ebotcazou@act-europe.fr>
>
> 	* langhooks.h (can_promote_packed_bit_field_p): New.
> 	* langhooks.c (lhd_can_promote_packed_bit_field_p): New function.
> 	* langhooks-def.h (lhd_can_promote_packed_bit_field_p): Declare it.
> 	(LANG_HOOKS_CAN_PROMOTE_PACKED_BIT_FIELD_P): Define to it.
> 	(LANG_HOOKS_INITIALIZER): Add LANG_HOOKS_CAN_PROMOTE_PACKED_BIT_FIELD_P.
> 	* stor-layout.c (layout_decl): Attempt to promote a bit-field only
> 	after the default alignment has been computed.  Do not promote it
> 	if the alignment was forced to the minimal one because of packedness,
> 	unless the language specifically allows it.
> 	(lang_adjust_rli): Remove.
> 	(set_lang_adjust_rli): Likewise.
> 	(layout_type): Remove invocation of set_lang_adjust_rli.
> 	* tree.h (set_lang_adjust_rli): Remove.
> 	* ada/misc.c (gnat_adjust_rli): Remove.
> 	(gnat_init): Remove invocation of set_lang_adjust_rli.
> 	(gnat_can_promote_packed_bit_field_p): New function.
> 	(LANG_HOOKS_CAN_PROMOTE_PACKED_BIT_FIELD_P): Set it
> 	to gnat_can_promote_packed_bit_field_p.

Could a global maintainer take a look at this?
http://gcc.gnu.org/ml/gcc-patches/2004-11/msg01459.html

Maybe Jason, since you already toyed with the stor-layout.c code.

This is an annoying regression for the 3.4 and 4.0 Ada compilers on 
STRICT_ALIGNMENT targets.

Thanks in advance.

-- 
Eric Botcazou



More information about the Gcc-patches mailing list