From patchwork Thu May 25 08:05:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Marc_Poulhi=C3=A8s?= X-Patchwork-Id: 98850 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp197342vqr; Thu, 25 May 2023 01:14:32 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5bCsMhDwvg2SS+2eYWnJ8qJzz9+uRPq35Gi9NXpIv4orxaBmWwatGJSXT4N5VU+nhsCIPl X-Received: by 2002:a17:907:a41:b0:973:7071:9b30 with SMTP id be1-20020a1709070a4100b0097370719b30mr684646ejc.51.1685002472269; Thu, 25 May 2023 01:14:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685002472; cv=none; d=google.com; s=arc-20160816; b=Jd/4hs1VKUVhQs9UkiSdIxWkx74UOW28+R6Ofol9GICCdIT3ZdBrjS1osxJwD7W/3H b9OTeqW8Aqn2PgjjOKCTBEEfPXj953uc2D8JBLSwuJOXte4onW9Xl4ifX97kwuM0QXIo BB23Tp3T+hM43Gr3FQHABUvdGY/OejWNBt1TASI34xN+2aW4Gy9YI9RaY9qBOHti6IVg OJ67VvnJ+ilfL3wDL62KAkVRcPkj+JVIGZ6rfC7D8kN5F+YVHVdH4ntr4uga6Ai0pU8x IWIz+lFDqar1/hRSlCrPxG76DMXFugPilc+TdeAQJVpYEH/akbkMsu8d9osBgw179oPH sNow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=Cm27shV4gZh9g20BGp9d8q7PT1LhUIozksSEjioQmtY=; b=vO3Mae9tZ4gidIlXWUGq3UkApEiKu2MDgx2yMSx0UIVxuyxhQxgsDj4/TqAiK+MfxG jQSOee+Rmx7pNBzlhj6yqv+3BaO/3K4JxR4amLXnP4xlUgVHeFLXZYMcA62JzdNr7tHx DIvh/DDudX3l23Da56h0CR9uCf8kP/TNx8JEq21mQatf043UFoIf/jA1nTR5bREiXjge zMMwAFrPWjSBEfEiEGRZvZVKxxUbXCwkzM5QvD7BasCIvuz3EYHxp+wCwrpzC30PUnWY IpPoh0vehGOIOKlpRNGjfsMRncvYf9TbiQlImBiUj/iO/U8j0clPpH75ZqhkWqw3Zg78 erSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=S3OWEE0U; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id ho7-20020a1709070e8700b009538c51ee57si851882ejc.215.2023.05.25.01.14.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 01:14:32 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=S3OWEE0U; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D536F3846438 for ; Thu, 25 May 2023 08:09:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D536F3846438 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685002196; bh=Cm27shV4gZh9g20BGp9d8q7PT1LhUIozksSEjioQmtY=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=S3OWEE0UNZ946WPYCDyHdaBfLm8zA/PPUK1h5/5izIP9p89h9OLKY7DQafX4dR8og G1SVVr+nW1TARof747hM9EvvtUSXsC+Ebotr/QNUWtwRnhwHZq6v3zNsevoYXUhY7F m/w7doRTLi750mxMgWCeK3gN0IvAPWITG+dD9OFI= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by sourceware.org (Postfix) with ESMTPS id B2E27385771F for ; Thu, 25 May 2023 08:05:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B2E27385771F Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-3f6da07feb2so1683555e9.0 for ; Thu, 25 May 2023 01:05:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685001931; x=1687593931; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Cm27shV4gZh9g20BGp9d8q7PT1LhUIozksSEjioQmtY=; b=hWcvPUnV5S03xPI1Nqg8q2lufkTWZV/Gw0j1EuRkvnLB6Fmy0Pi1KkEb6z6pCfJQ8K N1Q4s/psq9UMTtswVcRs5TRrdxiZBC308mrGmz+l2a9GZ+bQZk87/xx5iLTeSsveHTyo 4a4pQA37Pd5wecoA/1tdNJvsLobNrrGXkmCmi1+ezpqBtXyrG7LwmiZnwrA/olcwqRQ2 893iLzRSwOPy77Wr7EsxQ9/v9tGiBFYlbnZPqknW8vA4AoCWxNbGf6ASXBkI2A9aC3ah /sbVMcG9Au+3IQLm475mF87iBx7uUCdp6wbCCyPnupwXRT/+lOMqU2Jerogu5HjDdjRY 7e7w== X-Gm-Message-State: AC+VfDxIg5YXcKYYgAS7XdEoJEjUk0tbxEUxdPnScnsqjg/qAfezgv3f CSuIeSFeugXzrbIN5HOL3361Qd7o9IDuo5uncsnJ1w== X-Received: by 2002:a7b:ca54:0:b0:3f4:2bb3:a5bb with SMTP id m20-20020a7bca54000000b003f42bb3a5bbmr1284160wml.9.1685001931528; Thu, 25 May 2023 01:05:31 -0700 (PDT) Received: from poulhies-Precision-5550.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id c7-20020a05600c0ac700b003f4fb5532a1sm1154184wmr.43.2023.05.25.01.05.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 01:05:30 -0700 (PDT) To: gcc-patches@gcc.gnu.org Cc: Bob Duff Subject: [COMMITTED] ada: Add Entry_Cancel_Parameter to E_Label Date: Thu, 25 May 2023 10:05:30 +0200 Message-Id: <20230525080530.1955851-1-poulhies@adacore.com> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 X-Spam-Status: No, score=-13.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: =?utf-8?q?Marc_Poulhi=C3=A8s_via_Gcc-patches?= From: =?utf-8?q?Marc_Poulhi=C3=A8s?= Reply-To: =?utf-8?q?Marc_Poulhi=C3=A8s?= Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766853152013057831?= X-GMAIL-MSGID: =?utf-8?q?1766853152013057831?= From: Bob Duff ...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. Tested on x86_64-pc-linux-gnu, committed on master. --- 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