aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/decl.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2008-06-09 09:41:16 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2008-06-09 09:41:16 +0000
commit912cb4420dab339e6f07bb8222c3ea75514a2583 (patch)
treecf96aab5ea1b9dabffded7ef9da2d17a1a7f95b0 /gcc/ada/decl.c
parent2c2b17103d38452f39a4a1297c6577e7d2b2f8d9 (diff)
downloadgcc-912cb4420dab339e6f07bb8222c3ea75514a2583.zip
gcc-912cb4420dab339e6f07bb8222c3ea75514a2583.tar.gz
gcc-912cb4420dab339e6f07bb8222c3ea75514a2583.tar.bz2
decl.c (components_to_record): Adjust the packedness for the qualified union as well.
* decl.c (components_to_record): Adjust the packedness for the qualified union as well. From-SVN: r136583
Diffstat (limited to 'gcc/ada/decl.c')
-rw-r--r--gcc/ada/decl.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/ada/decl.c b/gcc/ada/decl.c
index 01827b4..b8bcb4b 100644
--- a/gcc/ada/decl.c
+++ b/gcc/ada/decl.c
@@ -6461,6 +6461,8 @@ components_to_record (tree gnu_record_type, Node_Id component_list,
/* Only make the QUAL_UNION_TYPE if there are any non-empty variants. */
if (gnu_variant_list)
{
+ int union_field_packed;
+
if (all_rep_and_size)
{
TYPE_SIZE (gnu_union_type) = TYPE_SIZE (gnu_record_type);
@@ -6482,9 +6484,13 @@ components_to_record (tree gnu_record_type, Node_Id component_list,
return;
}
+ /* Deal with packedness like in gnat_to_gnu_field. */
+ union_field_packed
+ = adjust_packed (gnu_union_type, gnu_record_type, packed);
+
gnu_union_field
= create_field_decl (gnu_var_name, gnu_union_type, gnu_record_type,
- packed,
+ union_field_packed,
all_rep ? TYPE_SIZE (gnu_union_type) : 0,
all_rep ? bitsize_zero_node : 0, 0);