From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1914) id 3B77E3834E59; Mon, 4 Jul 2022 07:51:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3B77E3834E59 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-1442] [Ada] Adjust previous change to Rewrite_As_Renaming X-Act-Checkin: gcc X-Git-Author: Eric Botcazou X-Git-Refname: refs/heads/master X-Git-Oldrev: 2cad8a59a8060b0897d18d4075d96eb7c541e845 X-Git-Newrev: 0896e2b79a3f7864b08f221a157a5c7fe8958116 Message-Id: <20220704075134.3B77E3834E59@sourceware.org> Date: Mon, 4 Jul 2022 07:51:34 +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: Mon, 04 Jul 2022 07:51:34 -0000 https://gcc.gnu.org/g:0896e2b79a3f7864b08f221a157a5c7fe8958116 commit r13-1442-g0896e2b79a3f7864b08f221a157a5c7fe8958116 Author: Eric Botcazou Date: Sun May 29 13:35:57 2022 +0200 [Ada] Adjust previous change to Rewrite_As_Renaming gcc/ada/ * exp_ch3.adb (Expand_N_Object_Declaration.Rewrite_As_Renaming): Do not rewrite if the declaration has got constraints. * sinfo.ads (Case Expression Alternative): Fix typo. Diff: --- gcc/ada/exp_ch3.adb | 19 +++++++++++++------ gcc/ada/sinfo.ads | 2 +- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index 75d94b0947a..9759c8d0512 100644 --- a/gcc/ada/exp_ch3.adb +++ b/gcc/ada/exp_ch3.adb @@ -6865,13 +6865,20 @@ package body Exp_Ch3 is and then OK_To_Rename_Entity_Name (Prefix (Expr_Q))))); begin - -- ??? Return False if there are any aspect specifications, because - -- otherwise we duplicate that corresponding implicit attribute - -- definition, and call Insert_Action, which has no place to insert - -- the attribute definition. The attribute definition is stored in - -- Aspect_Rep_Item, which is not a list. + return Result - return Result and then No (Aspect_Specifications (N)); + -- The declaration cannot be rewritten if it has got constraints, + -- in other words the nominal subtype must be unconstrained. + + and then Is_Entity_Name (Original_Node (Obj_Def)) + + -- ??? Return False if there are any aspect specifications, because + -- otherwise we duplicate that corresponding implicit attribute + -- definition, and call Insert_Action, which has no place to insert + -- the attribute definition. The attribute definition is stored in + -- Aspect_Rep_Item, which is not a list. + + and then No (Aspect_Specifications (N)); end Rewrite_As_Renaming; -- Local variables diff --git a/gcc/ada/sinfo.ads b/gcc/ada/sinfo.ads index e18a427f9a2..57c6438130b 100644 --- a/gcc/ada/sinfo.ads +++ b/gcc/ada/sinfo.ads @@ -4651,7 +4651,7 @@ package Sinfo is -- Note: The Actions field temporarily holds any actions associated with -- evaluation of the Expression. During expansion of the case expression - -- these actions are wrapped into an N_Expressions_With_Actions node + -- these actions are wrapped into an N_Expression_With_Actions node -- replacing the original expression. -- Note: this node never appears in the tree passed to the back end,