diff options
author | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-01-06 11:58:36 +0000 |
---|---|---|
committer | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-01-06 11:58:36 +0000 |
commit | 20158426310a8f35177c2c3922cbd8bce14bdac9 (patch) | |
tree | cf02d15bdfda08e9a1039a888fab5cbfc2c6a4be /gcc/ada/gcc-interface/decl.c | |
parent | 05f5b58f5675dc091a47d79ccccee2acc7f74373 (diff) | |
download | gcc-20158426310a8f35177c2c3922cbd8bce14bdac9.tar.gz |
* gcc-interface/decl.c (gnat_to_gnu_entity) <discrete_type>: Do not
pack the field of the record type made for a misaligned type.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@194942 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/gcc-interface/decl.c')
-rw-r--r-- | gcc/ada/gcc-interface/decl.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index f7db364c641..f312c7d4cbe 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -1887,8 +1887,10 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) } /* If the type we are dealing with has got a smaller alignment than the - natural one, we need to wrap it up in a record type and under-align - the latter. We reuse the padding machinery for this purpose. */ + natural one, we need to wrap it up in a record type and misalign the + latter; we reuse the padding machinery for this purpose. Note that, + even if the record type is marked as packed because of misalignment, + we don't pack the field so as to give it the size of the type. */ else if (align > 0) { tree gnu_field_type, gnu_field; @@ -1918,7 +1920,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) a bitfield. */ gnu_field = create_field_decl (get_identifier ("F"), gnu_field_type, - gnu_type, NULL_TREE, bitsize_zero_node, 1, 0); + gnu_type, TYPE_SIZE (gnu_field_type), + bitsize_zero_node, 0, 0); finish_record_type (gnu_type, gnu_field, 2, debug_info_p); compute_record_mode (gnu_type); |