[Ada] Redo handling of consistency check for Optimize_Alignment

Eric Botcazou ebotcazou@adacore.com
Tue Apr 15 09:04:00 GMT 2008


> The attached patch is the Gigi support for Optimize_Alignment applied to
> stand-alone objects: when not optimizing alignment for space, the alignment
> of some of these objects is promoted to the smallest power of 2 greater (or
> equal) than their size.

More adjustments are needed to fully support this.

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


2008-04-15  Eric Botcazou  <ebotcazou@adacore.com>

	* ada-tree.h (DECL_BY_COMPONENT_PTR_P): Use DECL_LANG_FLAG_3.
	* decl.c (gnat_to_gnu_entity) <object>: Call maybe_pad_type only
	if a size or alignment is specified.  Do not take into account
	alignment promotions for the computation of the object's size.
	<type>: Call maybe_pad_type only if a size or alignment is specified.
	(maybe_pad_type): Really reuse the RM_Size of the original type if
	requested.
	* trans.c (Attribute_to_gnu): Fix a couple of nits.
	* utils2.c (build_binary_op) <MODIFY_EXPR>: Merge related conditional
	statements.  Use the padded view of the type when copying between
	padded objects of the same underlying type.


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


More information about the Gcc-patches mailing list