aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/decl.c
diff options
context:
space:
mode:
authorOlivier Hainque <hainque@adacore.com>2007-12-07 10:50:23 +0000
committerOlivier Hainque <hainque@gcc.gnu.org>2007-12-07 10:50:23 +0000
commit5a2fe31acfc1f03b8954b1d5358ce8411772423e (patch)
tree4a1f91a442cfdd5c6bb0f36d7cf1872f25eda846 /gcc/ada/decl.c
parent9225443e8ba248edba04c757fb624d9be372e049 (diff)
downloadgcc-5a2fe31acfc1f03b8954b1d5358ce8411772423e.zip
gcc-5a2fe31acfc1f03b8954b1d5358ce8411772423e.tar.gz
gcc-5a2fe31acfc1f03b8954b1d5358ce8411772423e.tar.bz2
re PR ada/34173 (FAIL: gnat.dg/release_unc_maxalign.adb execution test)
2007-12-07 Olivier Hainque <hainque@adacore.com> PR ada/34173 * decl.c (gnat_to_gnu_entity) <case E_Array_Type>: When setting the alignment on the GCC XUA array type, set TYPE_USER_ALIGN if this is from an alignment clause on the GNAT entity. * utils.c (create_field_decl): Rewrite the computation of DECL_ALIGN to distinguish the case where we set it from the type's alignment. When so, propagate TYPE_USER_ALIGN into DECL_USER_ALIGN to indicate whether this alignment was set from an explicit alignment clause. From-SVN: r130673
Diffstat (limited to 'gcc/ada/decl.c')
-rw-r--r--gcc/ada/decl.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/ada/decl.c b/gcc/ada/decl.c
index 7c18a50..1a8cc77 100644
--- a/gcc/ada/decl.c
+++ b/gcc/ada/decl.c
@@ -1795,7 +1795,9 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
}
/* If an alignment is specified, use it if valid. But ignore it for
- types that represent the unpacked base type for packed arrays. */
+ types that represent the unpacked base type for packed arrays. If
+ the alignment was requested with an explicit user alignment clause,
+ state so. */
if (No (Packed_Array_Type (gnat_entity))
&& Known_Alignment (gnat_entity))
{
@@ -1803,6 +1805,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
TYPE_ALIGN (tem)
= validate_alignment (Alignment (gnat_entity), gnat_entity,
TYPE_ALIGN (tem));
+ if (Present (Alignment_Clause (gnat_entity)))
+ TYPE_USER_ALIGN (tem) = 1;
}
TYPE_CONVENTION_FORTRAN_P (tem)