From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7871) id 579C53858436; Thu, 25 May 2023 08:04:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 579C53858436 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685001895; bh=7Hvt3SDzGY9mZHz195z+Rx7duqrqn/GGb0Kx1yXp/bI=; h=From:To:Subject:Date:From; b=hB32X3CTJ/xQwYnTSDA6fo7r5j2MqK+IfmuQXb2+NI8ZTOqwlnY6rvTu0L7prZfvP sHFi7LgrKjdhYdZLwazz3lIoQ7i2xVbHM/lJRtdSV4N6i7ojVnmkmGlWoIltJAWxgY Ax8fcyt6mS/CHoucilhbgvM23/ok3/qPVqEsfNXM= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Marc Poulhi?s To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-1201] ada: Add Entry_Cancel_Parameter to E_Label X-Act-Checkin: gcc X-Git-Author: Bob Duff X-Git-Refname: refs/heads/master X-Git-Oldrev: 5ca595d97bb99839604ea9a60dce0abc336ed1e5 X-Git-Newrev: f26005d533d5ecd25cb95f2bb542cd77a51ea418 Message-Id: <20230525080455.579C53858436@sourceware.org> Date: Thu, 25 May 2023 08:04:54 +0000 (GMT) List-Id: https://gcc.gnu.org/g:f26005d533d5ecd25cb95f2bb542cd77a51ea418 commit r14-1201-gf26005d533d5ecd25cb95f2bb542cd77a51ea418 Author: Bob Duff Date: Thu Mar 2 10:12:29 2023 -0500 ada: Add Entry_Cancel_Parameter to E_Label ...and other (minor) changes. gcc/ada/ * gen_il-gen-gen_entities.adb (E_Label): Add Entry_Cancel_Parameter. This is necessary because Analyze_Implicit_Label_Declaration set the Ekind to E_Label. Without this change, this field would fail the vanishing-fields check in Atree (which is currently commented out). * einfo.ads (Entry_Cancel_Parameter): Document for E_Label. * sem_eval.adb (Why_Not_Static): Protect against previous errors (no need to explain why something is not static if it's already illegal for other reasons). * sem_util.ads (Enter_Name): Fix misleading comment. Diff: --- gcc/ada/einfo.ads | 3 +++ gcc/ada/gen_il-gen-gen_entities.adb | 1 + gcc/ada/sem_eval.adb | 2 +- gcc/ada/sem_util.ads | 6 ++++-- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads index b39cffd172c..7dc2bd178cc 100644 --- a/gcc/ada/einfo.ads +++ b/gcc/ada/einfo.ads @@ -1131,6 +1131,8 @@ package Einfo is -- object for task entry calls and a Communications_Block object -- in the case of protected entry calls. In both cases the objects -- are declared in outer scopes to this block. +-- This is also defined in labels, because we temporarily set the +-- Ekind of an E_Block to E_Label in Analyze_Implicit_Label_Declaration. -- Entry_Component -- Defined in formal parameters (in, in out and out parameters). Used @@ -5660,6 +5662,7 @@ package Einfo is -- E_Label -- Renamed_Object $$$ -- Renamed_Entity $$$ + -- Entry_Cancel_Parameter -- Enclosing_Scope -- Reachable diff --git a/gcc/ada/gen_il-gen-gen_entities.adb b/gcc/ada/gen_il-gen-gen_entities.adb index ebc0f204b03..67efc5d0f9a 100644 --- a/gcc/ada/gen_il-gen-gen_entities.adb +++ b/gcc/ada/gen_il-gen-gen_entities.adb @@ -1224,6 +1224,7 @@ begin -- Gen_IL.Gen.Gen_Entities -- implicit label declaration, not the occurrence of the label itself, -- which is simply a direct name referring to the label. (Sm (Enclosing_Scope, Node_Id), + Sm (Entry_Cancel_Parameter, Node_Id), Sm (Reachable, Flag), Sm (Renamed_Or_Alias, Node_Id))); diff --git a/gcc/ada/sem_eval.adb b/gcc/ada/sem_eval.adb index e54f4a637e2..905e7ff55b7 100644 --- a/gcc/ada/sem_eval.adb +++ b/gcc/ada/sem_eval.adb @@ -7611,7 +7611,7 @@ package body Sem_Eval is Error_Msg_NE ("!& is not a static subtype (RM 4.9(26))", N, E); - else + elsif E /= Any_Id then Error_Msg_NE ("!& is not static constant or named number " & "(RM 4.9(5))", N, E); diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads index 4028d370823..4962c62fa7d 100644 --- a/gcc/ada/sem_util.ads +++ b/gcc/ada/sem_util.ads @@ -809,8 +809,10 @@ package Sem_Util is procedure Enter_Name (Def_Id : Entity_Id); -- Insert new name in symbol table of current scope with check for -- duplications (error message is issued if a conflict is found). - -- Note: Enter_Name is not used for overloadable entities, instead these - -- are entered using Sem_Ch6.Enter_Overloaded_Entity. + -- Note: Enter_Name is not used for most overloadable entities, instead + -- they are entered using Sem_Ch6.Enter_Overloaded_Entity. However, + -- this is used for SOME overloadable entities, such as enumeration + -- literals and certain operator symbols. function Entity_Of (N : Node_Id) return Entity_Id; -- Obtain the entity of arbitrary node N. If N is a renaming, return the