From: Eric Botcazou Date: Sat, 9 May 2020 20:38:29 +0000 (+0200) Subject: Fix problematic cases of wrapping X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=aff220748ca669d4338c5ac6f0b210a29f90bbab;p=gcc.git Fix problematic cases of wrapping * gcc-interface/trans.c (gnat_to_gnu): Do not wrap boolean values if they appear in any kind of attribute references. --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 6aec0eeede1..814e5507e48 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2020-05-09 Eric Botcazou + + * gcc-interface/trans.c (gnat_to_gnu): Do not wrap boolean values if + they appear in any kind of attribute references. + 2020-05-09 Eric Botcazou * gcc-interface/trans.c (gnat_to_gnu) : Deal diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c index 5de04abb97f..44b156ac3d8 100644 --- a/gcc/ada/gcc-interface/trans.c +++ b/gcc/ada/gcc-interface/trans.c @@ -8695,8 +8695,9 @@ 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) - && Nkind (Parent (gnat_node)) != N_Variant_Part) + && Nkind (Parent (gnat_node)) != N_Attribute_Reference + && Nkind (Parent (gnat_node)) != N_Variant_Part + && !lvalue_required_p (gnat_node, gnu_result_type, false, false)) { gnu_result = build_binary_op (NE_EXPR, gnu_result_type,