aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/trans.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2018-12-11 11:11:47 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2018-12-11 11:11:47 +0000
commitf2bee2395180f0e45177ccdd92dca8f327679e46 (patch)
treeba9cc997c6aebee5701c710b57e0a025241db706 /gcc/ada/gcc-interface/trans.c
parent619bfd9fef74000750b1683efc79909798104940 (diff)
downloadgcc-f2bee2395180f0e45177ccdd92dca8f327679e46.zip
gcc-f2bee2395180f0e45177ccdd92dca8f327679e46.tar.gz
gcc-f2bee2395180f0e45177ccdd92dca8f327679e46.tar.bz2
[Ada] Fix -gnatR3 output for dynamically constrained record
2018-12-11 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * gcc-interface/decl.c (gnat_to_gnu_entity): Add gnat_annotate_type local variable initialized to Empty. <E_Record_Subtype>: Set it to the Cloned_Subtype, if any. For types, back-annotate alignment and size values earlier and only if the DECL was created here; otherwise, if gnat_annotate_type is present, take the values from it. (gnat_to_gnu_field): Add gnat_clause local variable. If a component clause is present, call validate_size only once on the Esize of the component. Otherwise, in the packed case, do not call validate_size again on the type of the component but retrieve directly its RM size. (components_to_record): Minor tweak. (set_rm_size): Remove useless test. * gcc-interface/trans.c (gnat_to_gnu): Do wrap the instance of a boolean discriminant attached to a variant part. From-SVN: r267008
Diffstat (limited to 'gcc/ada/gcc-interface/trans.c')
-rw-r--r--gcc/ada/gcc-interface/trans.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
index c2553d8..35b71ef 100644
--- a/gcc/ada/gcc-interface/trans.c
+++ b/gcc/ada/gcc-interface/trans.c
@@ -8567,7 +8567,8 @@ gnat_to_gnu (Node_Id gnat_node)
|| kind == N_Indexed_Component
|| kind == N_Selected_Component)
&& TREE_CODE (get_base_type (gnu_result_type)) == BOOLEAN_TYPE
- && !lvalue_required_p (gnat_node, gnu_result_type, false, false))
+ && !lvalue_required_p (gnat_node, gnu_result_type, false, false)
+ && Nkind (Parent (gnat_node)) != N_Variant_Part)
{
gnu_result
= build_binary_op (NE_EXPR, gnu_result_type,