From 98ae7998b2bbf138ca92bd8781e33c5f966ed4c6 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Sat, 19 Apr 2008 00:55:49 +0000 Subject: [PATCH] decl.c (gnat_to_gnu_entity): When trying to promote the alignment... * decl.c (gnat_to_gnu_entity) : 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 | 6 ++++++ gcc/ada/decl.c | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 2242667c1a1..f70e616a29e 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,9 @@ +2008-04-18 Eric Botcazou + + * decl.c (gnat_to_gnu_entity) : 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 * decl.c (maybe_pad_type): Only generate the XVS parallel type if diff --git a/gcc/ada/decl.c b/gcc/ada/decl.c index 525dad807fa..9d4412dc358 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 } -- 2.30.2