decl.c (gnat_to_gnu_entity): Do not force BIGGEST_ALIGNMENT when capping the alignmen...
authorEric Botcazou <ebotcazou@adacore.com>
Sat, 8 Mar 2008 12:01:22 +0000 (12:01 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Sat, 8 Mar 2008 12:01:22 +0000 (12:01 +0000)
* 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.

From-SVN: r133031

gcc/ada/ChangeLog
gcc/ada/decl.c

index bbca1567488aa691fbcfa8fb488fa2a2500efd94..ba99678f9d6f402e3794891b06daa812d258aa4e 100644 (file)
@@ -1,3 +1,9 @@
+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.
+
 2008-03-08  Eric Botcazou  <ebotcazou@adacore.com>
 
        * lang-specs.h: Pass -gnatwa if -Wall is passed.
index 62783202f01fc125800194d57ff3c9fd1ec7ec13..2c88c0fe57615d2fa4451adc41f03a6fd601629c 100644 (file)
@@ -2575,8 +2575,9 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
                 && 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;