From patchwork Tue Nov 22 12:36:54 2022 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: 60975 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8583E385828E for ; Tue, 22 Nov 2022 12:38:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8583E385828E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669120698; bh=XrYBopEC/xtPhk2frvyl7FD2KrONxlrGzsUPcelmogQ=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=PL2OVYNgIIHFuMoZgVyvtb91SoapE0a88Rhu8MmvFQ4a9lqvji6zmlULkSdAvSatN EtpgZqs0B2ha6QlMoBUr488+G/k8cyohN6DpfXnl8N6fS2lH4JOvqMz/a4awzvdSGb oazpTgBrcIo4UbCStlQK4fZ8Mq7nUZepnF6rmu44= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by sourceware.org (Postfix) with ESMTPS id 4F3643853D4E for ; Tue, 22 Nov 2022 12:36:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4F3643853D4E Received: by mail-wm1-x331.google.com with SMTP id t4so10597170wmj.5 for ; Tue, 22 Nov 2022 04:36:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=XrYBopEC/xtPhk2frvyl7FD2KrONxlrGzsUPcelmogQ=; b=aIzeo0ZrIPhDJVxeJwlFWzshcc3EPey9qjnBtE0iNmCQTF/GYVVqNQfdQW930noeHk biryTC4mIFmjJw2zbFwdcaybz2bn01J35IOdhFHghQ0NEcp76cskNdXLTcc+OqAMtkuQ 8IhOPv2xqKuQHuRwa0oGjKJK8x+/n0qQpSfqgcZMsbYl49P1s38PdtkbF/F8NRMECvbi pPBQm0QNIZzwTJvqg2mrBYQwnoJAsBQTp0I+74n0xTmLXxsOJvoIK1FSEP61+TJgXC8d cya7nYG2WJB5W5W9f5Dr9b0unu+x7dHWNEATG02lgcFluu7E3zioK+jGoeoTiB2zKOsj W1dg== X-Gm-Message-State: ANoB5pl1DILDd+lL/2EzoGeS7I1kPOC9qhOAhXkeQ/wYEfCkY/CTRe12 WAynnrpRzYhyCRPMwOGI8f6if4JXxhSYBQ== X-Google-Smtp-Source: AA0mqf5k9JJlcxDoAZUrhh4Dn9QEm0OJXpFmJlZp7R1dEKZaZsE4q7QPdX1hzB/DMRngi7lLasnJyQ== X-Received: by 2002:a7b:c046:0:b0:3cf:d58f:f66e with SMTP id u6-20020a7bc046000000b003cfd58ff66emr3123652wmc.165.1669120616106; Tue, 22 Nov 2022 04:36:56 -0800 (PST) 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 z11-20020a05600c0a0b00b003c6f1732f65sm24467556wmp.38.2022.11.22.04.36.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Nov 2022 04:36:55 -0800 (PST) To: gcc-patches@gcc.gnu.org Cc: Ghjuvan Lacambre Subject: [COMMITTED] ada: Disable checking of Elab_Spec procedures in CodePeer_Mode Date: Tue, 22 Nov 2022 13:36:54 +0100 Message-Id: <20221122123654.336392-1-poulhies@adacore.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 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 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+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" From: Ghjuvan Lacambre This commit re-enables the Validate_Subprogram_Calls check that had been disabled in a previous commit and has said check skip over Elab_Spec procedures in CodePeer_Mode. gcc/ada/ * frontend.adb (Frontend): Re-enable Validate_Subprogram_Calls. * exp_ch6.adb (Check_BIP_Actuals): When in CodePeer mode, do not attempt to validate procedures coming from an Elab_Spec/Elab_Body/Elab_Subp_Body procedure. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_ch6.adb | 17 +++++++++++++++++ gcc/ada/frontend.adb | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb index a5dee38c55f..237a19d1327 100644 --- a/gcc/ada/exp_ch6.adb +++ b/gcc/ada/exp_ch6.adb @@ -1115,6 +1115,23 @@ package body Exp_Ch6 is | N_Function_Call | N_Procedure_Call_Statement); + -- In CodePeer_Mode, the tree for `'Elab_Spec` procedures will be + -- malformed because GNAT does not perform the usual expansion that + -- results in the importation of external elaboration procedure symbols. + -- This is expected: the CodePeer backend has special handling for this + -- malformed tree. + -- Thus, we do not need to check the tree (and in fact can't, because + -- it's malformed). + + if CodePeer_Mode + and then Nkind (Name (Subp_Call)) = N_Attribute_Reference + and then Attribute_Name (Name (Subp_Call)) in Name_Elab_Spec + | Name_Elab_Body + | Name_Elab_Subp_Body + then + return True; + end if; + Formal := First_Formal_With_Extras (Subp_Id); Actual := First_Actual (Subp_Call); diff --git a/gcc/ada/frontend.adb b/gcc/ada/frontend.adb index bc3da30b0cf..033ecf3b7be 100644 --- a/gcc/ada/frontend.adb +++ b/gcc/ada/frontend.adb @@ -531,7 +531,7 @@ begin -- formals). It is invoked using pragma Debug to avoid adding any cost -- when the compiler is built with assertions disabled. - if not Debug_Flag_Underscore_XX and then not CodePeer_Mode then + if not Debug_Flag_Underscore_XX then pragma Debug (Exp_Ch6.Validate_Subprogram_Calls (Cunit (Main_Unit))); end if;