From a01ebdf51662cecd53108b8231cdff7fbf7fbde4 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Mon, 1 May 2017 08:24:40 +0000 Subject: [PATCH] * gcc-interface/decl.c (components_to_record): Add missing guard. From-SVN: r247427 --- gcc/ada/gcc-interface/decl.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index c243d40d17b..75b0475fe5e 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -8150,13 +8150,20 @@ components_to_record (Node_Id gnat_component_list, Entity_Id gnat_record_type, 5) the variant part, within the record and within each variant recursively. */ - if (w_reorder - && last_reorder_field_type == 2 - && tmp_last_reorder_field_type < 2) - warn_on_field_placement (gnu_tmp_bitp_list - ? gnu_tmp_bitp_list : gnu_field_list, - gnat_component_list, gnat_record_type, - in_variant, do_reorder); + + if (w_reorder) + { + /* If we have pending bit-packed fields, warn if they would be moved + to after regular fields. */ + if (last_reorder_field_type == 2 + && tmp_bitp_size != 0 + && tmp_last_reorder_field_type < 2) + warn_on_field_placement (gnu_tmp_bitp_list + ? gnu_tmp_bitp_list : gnu_field_list, + gnat_component_list, gnat_record_type, + in_variant, do_reorder); + } + if (do_reorder) { /* If we have pending bit-packed fields on the temporary list, we put -- 2.30.2