decl.c (gnat_to_gnu_entity): When trying to promote the alignment...
authorEric Botcazou <ebotcazou@adacore.com>
Sat, 19 Apr 2008 00:55:49 +0000 (00:55 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Sat, 19 Apr 2008 00:55:49 +0000 (00:55 +0000)
* decl.c (gnat_to_gnu_entity) <object>: When trying to promote the
alignment, reset it to zero if it would end up not being greater
than that of the type.

From-SVN: r134461

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

index 2242667..f70e616 100644 (file)
@@ -1,5 +1,11 @@
 2008-04-18  Eric Botcazou  <ebotcazou@adacore.com>
 
+       * decl.c (gnat_to_gnu_entity) <object>: When trying to promote the
+       alignment, reset it to zero if it would end up not being greater
+       than that of the type.
+
+2008-04-18  Eric Botcazou  <ebotcazou@adacore.com>
+
        * decl.c (maybe_pad_type): Only generate the XVS parallel type if
        the padded type has a variable size.
 
index 525dad8..9d4412d 100644 (file)
@@ -700,12 +700,12 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
              align = ceil_alignment (tree_low_cst (TYPE_SIZE (gnu_type), 1));
 
            /* But make sure not to under-align the object.  */
-           if (align < TYPE_ALIGN (gnu_type))
-             align = TYPE_ALIGN (gnu_type);
+           if (align <= TYPE_ALIGN (gnu_type))
+             align = 0;
 
            /* And honor the minimum valid atomic alignment, if any.  */
 #ifdef MINIMUM_ATOMIC_ALIGNMENT
-           if (align < MINIMUM_ATOMIC_ALIGNMENT)
+           else if (align < MINIMUM_ATOMIC_ALIGNMENT)
              align = MINIMUM_ATOMIC_ALIGNMENT;
 #endif
          }