This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] Do not force BIGGEST_ALIGNMENT


We don't need to force BIGGEST_ALIGNMENT when capping the alignment of records 
with strict alignment and size clause, since it's already the biggest.  This 
should prevent the over-alignment circuitry from being gratuitously invoked.

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


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

	* decl.c (gnat_to_gnu_entity) <E_Record_Type>: Do not force
	BIGGEST_ALIGNMENT when capping the alignment of records with
	strict alignment and size clause.


-- 
Eric Botcazou
Index: decl.c
===================================================================
--- decl.c	(revision 133027)
+++ decl.c	(working copy)
@@ -2575,8 +2575,9 @@ gnat_to_gnu_entity (Entity_Id gnat_entit
 		 && Known_Static_Esize (gnat_entity))
 	  {
 	    unsigned int raw_size = UI_To_Int (Esize (gnat_entity));
-	    TYPE_ALIGN (gnu_type)
-	      = MIN (BIGGEST_ALIGNMENT, raw_size & -raw_size);
+	    unsigned int raw_align = raw_size & -raw_size;
+	    if (raw_align < BIGGEST_ALIGNMENT)
+	      TYPE_ALIGN (gnu_type) = raw_align;
 	  }
 	else
 	  TYPE_ALIGN (gnu_type) = 0;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]