From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1914) id 1F2D2381E5CD; Wed, 13 Jul 2022 10:04:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1F2D2381E5CD MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Pierre-Marie de Rodat To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-1682] [Ada] Small housekeeping work in gigi X-Act-Checkin: gcc X-Git-Author: Eric Botcazou X-Git-Refname: refs/heads/master X-Git-Oldrev: 1f3f64b9e777a706662554ef39a512544244ef0c X-Git-Newrev: 0c5730a64d9ee29b84cb423cdb2cf3ab3c568701 Message-Id: <20220713100459.1F2D2381E5CD@sourceware.org> Date: Wed, 13 Jul 2022 10:04:59 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jul 2022 10:04:59 -0000 https://gcc.gnu.org/g:0c5730a64d9ee29b84cb423cdb2cf3ab3c568701 commit r13-1682-g0c5730a64d9ee29b84cb423cdb2cf3ab3c568701 Author: Eric Botcazou Date: Sat Jul 9 11:10:15 2022 +0200 [Ada] Small housekeeping work in gigi gcc/ada/ * gcc-interface/trans.cc (gnat_to_gnu) : Fix a couple of minor issues in the commentary. Diff: --- gcc/ada/gcc-interface/trans.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gcc/ada/gcc-interface/trans.cc b/gcc/ada/gcc-interface/trans.cc index 9d7fd2b2377..c1dd567b2e4 100644 --- a/gcc/ada/gcc-interface/trans.cc +++ b/gcc/ada/gcc-interface/trans.cc @@ -7181,7 +7181,7 @@ gnat_to_gnu (Node_Id gnat_node) break; case N_Assignment_Statement: - /* Get the LHS and RHS of the statement and convert any reference to an + /* First get the LHS of the statement and convert any reference to an unconstrained array into a reference to the underlying array. */ gnu_lhs = maybe_unconstrained_array (gnat_to_gnu (Name (gnat_node))); @@ -7191,6 +7191,8 @@ gnat_to_gnu (Node_Id gnat_node) && !valid_constant_size_p (TYPE_SIZE_UNIT (TREE_TYPE (gnu_lhs)))) gnu_result = build_call_raise (SE_Object_Too_Large, gnat_node, N_Raise_Storage_Error); + + /* If the RHS is a function call, let Call_to_gnu do the entire work. */ else if (Nkind (Expression (gnat_node)) == N_Function_Call) { get_atomic_access (Name (gnat_node), &aa_type, &aa_sync); @@ -7198,6 +7200,8 @@ gnat_to_gnu (Node_Id gnat_node) = Call_to_gnu (Expression (gnat_node), &gnu_result_type, gnu_lhs, aa_type, aa_sync); } + + /* Otherwise we need to build the assignment statement manually. */ else { const Node_Id gnat_expr = Expression (gnat_node); @@ -7223,6 +7227,9 @@ gnat_to_gnu (Node_Id gnat_node) && Is_Single_Aggregate (gnat_temp)); gnu_rhs = gnat_to_gnu (gnat_temp); } + + /* Otherwise get the RHS of the statement and do the same processing + as for the LHS above. */ else gnu_rhs = maybe_unconstrained_array (gnat_to_gnu (gnat_expr));