From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1914) id 4B6B43850207; Wed, 13 Jul 2022 10:04:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4B6B43850207 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-1675] [Ada] Generate debug info entry for user-defined access subtype X-Act-Checkin: gcc X-Git-Author: Eric Botcazou X-Git-Refname: refs/heads/master X-Git-Oldrev: 589163e18a291ce6f0befc67be4ca9ad6924d959 X-Git-Newrev: 45808a572bac3d1585c8b7de829f39a931f3555c Message-Id: <20220713100423.4B6B43850207@sourceware.org> Date: Wed, 13 Jul 2022 10:04:23 +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:23 -0000 https://gcc.gnu.org/g:45808a572bac3d1585c8b7de829f39a931f3555c commit r13-1675-g45808a572bac3d1585c8b7de829f39a931f3555c Author: Eric Botcazou Date: Thu Jun 23 17:13:57 2022 +0200 [Ada] Generate debug info entry for user-defined access subtype This is consistent with the other kinds of subtypes. gcc/ada/ * gcc-interface/decl.cc (gnat_to_gnu_entity) : Do not reuse the TYPE_DECL of the base type. Diff: --- gcc/ada/gcc-interface/decl.cc | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc index 2510ee8bc67..e7bfc015379 100644 --- a/gcc/ada/gcc-interface/decl.cc +++ b/gcc/ada/gcc-interface/decl.cc @@ -3867,7 +3867,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) case E_Access_Subtype: /* We treat this as identical to its base type; any constraint is meaningful only to the front-end. */ - gnu_decl = gnat_to_gnu_entity (gnat_equiv_type, NULL_TREE, false); + gnu_type = gnat_to_gnu_type (gnat_equiv_type); maybe_present = true; /* The designated subtype must be elaborated as well, if it does @@ -3877,11 +3877,10 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) && Is_Frozen (Directly_Designated_Type (gnat_entity)) && No (Freeze_Node (Directly_Designated_Type (gnat_entity)))) { - tree gnu_base_type = TREE_TYPE (gnu_decl); - tree gnu_desig_base_type - = TYPE_IS_FAT_POINTER_P (gnu_base_type) - ? TREE_TYPE (TREE_TYPE (TYPE_FIELDS (gnu_base_type))) - : TREE_TYPE (gnu_base_type); + tree gnu_desig_type + = TYPE_IS_FAT_POINTER_P (gnu_type) + ? TREE_TYPE (TREE_TYPE (TYPE_FIELDS (gnu_type))) + : TREE_TYPE (gnu_type); /* If we are to defer elaborating incomplete types, make a dummy type node and elaborate it later. */ @@ -3898,7 +3897,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) /* Otherwise elaborate the designated subtype only if its base type has already been elaborated. */ - else if (!TYPE_IS_DUMMY_P (gnu_desig_base_type)) + else if (!TYPE_IS_DUMMY_P (gnu_desig_type)) gnat_to_gnu_entity (Directly_Designated_Type (gnat_entity), NULL_TREE, false); }