aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2008-04-19 00:55:49 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2008-04-19 00:55:49 +0000
commit98ae7998b2bbf138ca92bd8781e33c5f966ed4c6 (patch)
tree17580a08ec9074d1d2a6bd7ed2c31490d645f751 /gcc/ada
parent03659b50aeafb325eff0a2151b03c1247084bfcf (diff)
downloadgcc-98ae7998b2bbf138ca92bd8781e33c5f966ed4c6.zip
gcc-98ae7998b2bbf138ca92bd8781e33c5f966ed4c6.tar.gz
gcc-98ae7998b2bbf138ca92bd8781e33c5f966ed4c6.tar.bz2
decl.c (gnat_to_gnu_entity): When trying to promote the alignment...
* 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
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog6
-rw-r--r--gcc/ada/decl.c6
2 files changed, 9 insertions, 3 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 2242667..f70e616 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -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.
diff --git a/gcc/ada/decl.c b/gcc/ada/decl.c
index 525dad8..9d4412d 100644
--- a/gcc/ada/decl.c
+++ b/gcc/ada/decl.c
@@ -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
}