aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/decl.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2016-04-02 08:56:19 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2016-04-02 08:56:19 +0000
commit7d9979e629a54f0d7e3378c90c7eb1adfd76196e (patch)
tree9690b9b585bb4dd9f25f78db7b6a15848333ded1 /gcc/ada/gcc-interface/decl.c
parentddd6d4211a152d5f493fc634c210bbadb9ae0217 (diff)
downloadgcc-7d9979e629a54f0d7e3378c90c7eb1adfd76196e.zip
gcc-7d9979e629a54f0d7e3378c90c7eb1adfd76196e.tar.gz
gcc-7d9979e629a54f0d7e3378c90c7eb1adfd76196e.tar.bz2
decl.c (components_to_record): Restrict the previous change to fields with variable size.
* gcc-interface/decl.c (components_to_record): Restrict the previous change to fields with variable size. From-SVN: r234696
Diffstat (limited to 'gcc/ada/gcc-interface/decl.c')
-rw-r--r--gcc/ada/gcc-interface/decl.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index ad84528..87026e7 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -7606,13 +7606,15 @@ components_to_record (tree gnu_record_type, Node_Id gnat_component_list,
if (p_gnu_rep_list && gnu_rep_list)
*p_gnu_rep_list = chainon (*p_gnu_rep_list, gnu_rep_list);
- /* If only one field has a rep clause and it starts at 0, put back the field
- at the head of the regular field list. This will avoid creating a useless
- REP part below and deal with the annoying case of an extension of a record
- with variable size and rep clause, for which the _Parent field is forced
- at offset 0 and has variable size, which we do not support below. */
+ /* Deal with the annoying case of an extension of a record with variable size
+ and partial rep clause, for which the _Parent field is forced at offset 0
+ and has variable size, which we do not support below. Note that we cannot
+ do it if the field has fixed size because we rely on the presence of the
+ REP part built below to trigger the reordering of the fields in a derived
+ record type when all the fields have a fixed position. */
else if (gnu_rep_list
&& !DECL_CHAIN (gnu_rep_list)
+ && TREE_CODE (DECL_SIZE (gnu_rep_list)) != INTEGER_CST
&& !variants_have_rep
&& first_free_pos
&& integer_zerop (first_free_pos)