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 2242667c1a1a27e3120758bc1414f5e722ef0aad..f70e616a29e0fe982a46191eb592ba9b8f5bfeff 100644 (file)
@@ -1,3 +1,9 @@
+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
index 525dad807fa7a7fa88c74a4f8430e20470ed381d..9d4412dc35851873fe551b401649202592ff4ce7 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
          }