[Ada] Alignment promotion vs packedness

Eric Botcazou ebotcazou@adacore.com
Sat Mar 8 11:31:00 GMT 2008


The Ada compiler needs to promote the alignment of packed records if this is 
deemed profitable, for example

package P is

   type R1 is record
      I : Integer;
   end record;
   pragma Pack (R1);

end P;

in order to avoid creating superfluous temporaries around function calls.

Fixed thusly, tested on i586-suse-linux, applied on the mainline.


2008-03-08  Eric Botcazou  <ebotcazou@adacore.com>

	* utils.c (finish_record_type): Clear DECL_BIT_FIELD on sufficiently
	aligned bit-fields, bumping the alignment of the record type if deemed
	profitable.
	(value_factor_p): Return false instead of 0.


2008-03-08  Eric Botcazou  <ebotcazou@adacore.com>

        * gnat.dg/pack4.adb: New test.


-- 
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.diff
Type: text/x-diff
Size: 3542 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20080308/78cde1a4/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pack4.adb
Type: text/x-adasrc
Size: 590 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20080308/78cde1a4/attachment-0001.bin>


More information about the Gcc-patches mailing list