From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7871) id 97C103857BB2; Mon, 14 Nov 2022 13:51:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 97C103857BB2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668433893; bh=OoSKtnqfwVa0dL2BuKimpMSeOI7fkqOHKTKVeyClNks=; h=From:To:Subject:Date:From; b=V2mubTHEpZVnSYcycKve/8dIc2H9Xaj/YJCf5nWh43U2w/gxS6UnaYFSaPbAS6rDu 6HTqo/aPMQ1u6bRxb/I8b2l+WA4TbZu24QdOaFTN315Ypui2DkkbJ3rPwq0YpBMSqK VptMvynhQr2IpfHLTyrtnE34BN0+vUFyoY2fYZyI= 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 r13-4011] ada: Fix error on SPARK_Mode on library-level separate body X-Act-Checkin: gcc X-Git-Author: Yannick Moy X-Git-Refname: refs/heads/master X-Git-Oldrev: 28e5c45bd519aa363cba1eec4d215b173c360cab X-Git-Newrev: 442886a99dae94012575bcc1cd3407284da42081 Message-Id: <20221114135133.97C103857BB2@sourceware.org> Date: Mon, 14 Nov 2022 13:51:33 +0000 (GMT) List-Id: https://gcc.gnu.org/g:442886a99dae94012575bcc1cd3407284da42081 commit r13-4011-g442886a99dae94012575bcc1cd3407284da42081 Author: Yannick Moy Date: Mon Oct 31 11:33:12 2022 +0100 ada: Fix error on SPARK_Mode on library-level separate body When applying explicitly SPARK_Mode on a separate library-level spec and body for which a contract needs to be checked, compilation with -gnata was failing on a spurious error related to SPARK_Mode placement. Now fixed. gcc/ada/ * sem_prag.adb (Analyze_Pragma): Add special case for the special local subprogram created for contracts. Diff: --- gcc/ada/sem_prag.adb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 615c6d2110c..77fcb1c505f 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -23424,10 +23424,14 @@ package body Sem_Prag is Spec_Id : constant Entity_Id := Unique_Defining_Entity (Decl); begin - -- Ignore pragma when applied to the special body created for - -- inlining, recognized by its internal name _Parent. + -- Ignore pragma when applied to the special body created + -- for inlining, recognized by its internal name _Parent; or + -- when applied to the special body created for contracts, + -- recognized by its internal name _Wrapped_Statements. - if Chars (Body_Id) = Name_uParent then + if Chars (Body_Id) in Name_uParent + | Name_uWrapped_Statements + then return; end if;