From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by sourceware.org (Postfix) with ESMTPS id 4AF7E3843869 for ; Thu, 5 Jan 2023 14:40:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4AF7E3843869 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-wr1-x42d.google.com with SMTP id d17so16594356wrs.2 for ; Thu, 05 Jan 2023 06:40:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=lsU5lE5PM6zdfmsltoYJas6SmIY7R2kbVfTuWO6mglY=; b=EmzgBJ2Pm2UlVj8POd9sSs3UKKmCGUdlT+bb9os2C+sdnV1fuFnYYXwZ9TGUlmGXVE npCGi8GeU6/SocaPLJS2AgnoU+brB1Qk1j/Y2QNLG+YWldh9cYtgZYvQLfGFry2bSH7k r27fB8SjBOCqLyYuPgyfw5ewJRGaZUl/ikZBhot0HrK2+5EyiATiq8S4ii6csnEiJnqG QemypE1GIsH/6tgqNBo6lQdxqttJSCp2s8/jSj7pJvC3TzPfYeCL0oGeZNq4oXB5mHSC KNGLAhBW6daoSdQVYvOEoWpzwgZKP+6Fb4GG27HwWJHU77qkIcoN6iFLouXA345l2pWv 3XUQ== 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=lsU5lE5PM6zdfmsltoYJas6SmIY7R2kbVfTuWO6mglY=; b=pt9UYg3HJSal3hirNkqusWrFudAScw9BuNztQUcFDMxvVsmBZpk7GrLRjwDbUVZUo3 c0lavxjh9vWLKvsiT7ZcjnMMMM0Hix26FMdm7jE4vmEF0D+6z+lrIprKvKg+ye/4DUoA K9DLWQn2iu2sllDkfsqPiAW6ZJ0PAAPPHA+uqgB356RVp2iZoVDOkvlFY+X3GVC97+Ee CAe/6BQrc/uTKxxGH8nopvqAXP0MEJtMb0PC98KMkA1mEy2k+6pe3FFIvZjp+Sgplf3v +zbo/Rv6rtD15luX1gZTwp8wGWGTsONyo7qSCfPpNVxGpJhXJsfejETzBxW04GqQkD6m B4PQ== X-Gm-Message-State: AFqh2kpoDHiTuo2alj/fcPscjj5kCKG/mSZ/4FdmdAd3P9c5R3GVMaBH jCQ+aPuX9lK3JGuuPTXVoA7FWFo2+uJhLxVEQgQ= X-Google-Smtp-Source: AMrXdXuk065rlPxrh8zcvUFRRJRKjv59gzSEHNlOarnkZE1BQaj3bGTPusmNMN+tgfwuw1l7e7Gliw== X-Received: by 2002:adf:e743:0:b0:242:63de:2f5b with SMTP id c3-20020adfe743000000b0024263de2f5bmr34976961wrn.6.1672929658183; Thu, 05 Jan 2023 06:40:58 -0800 (PST) Received: from poulhies-Precision-5550.lan (static-176-191-105-132.ftth.abo.bbox.fr. [176.191.105.132]) by smtp.gmail.com with ESMTPSA id m15-20020adffa0f000000b0028f9132e9ddsm17887279wrr.39.2023.01.05.06.40.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 06:40:57 -0800 (PST) From: =?UTF-8?q?Marc=20Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [COMMITTED] ada: Remove unhelpful special case for renamed bodies in GNATprove mode Date: Thu, 5 Jan 2023 15:40:55 +0100 Message-Id: <20230105144055.156446-1-poulhies@adacore.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: From: Piotr Trojanek This patch reverts a special-case related to inlining of renamed bodies in GNATprove mode. Its idea was that inlining is decided in routine Cannot_Inline, which is called much later. This didn't quite work, because in the meantime the renamed body was prepared to inlining in Build_Body_To_Inline, which was not designed to handle renamed bodies. gcc/ada/ * freeze.adb (Build_Renamed_Body): Revert a special case for GNATprove; remove unnecessary initialization of a local variable. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/freeze.adb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb index 97a25d10835..a3ab685f5fc 100644 --- a/gcc/ada/freeze.adb +++ b/gcc/ada/freeze.adb @@ -398,7 +398,7 @@ package body Freeze is Nam : constant Node_Id := Name (N); Old_S : Entity_Id; Spec : constant Node_Id := New_Copy_Tree (Specification (Decl)); - Actuals : List_Id := No_List; + Actuals : List_Id; Call_Node : Node_Id; Call_Name : Node_Id; Body_Node : Node_Id; @@ -477,14 +477,11 @@ package body Freeze is -- calls to the renamed entity. The body must be generated in any case -- for calls that may appear elsewhere. This is not done in the case -- where the subprogram is an instantiation because the actual proper - -- body has not been built yet. This is also not done in GNATprove mode - -- as we need to check other conditions for creating a body to inline - -- in that case, which are controlled in Analyze_Subprogram_Body_Helper. + -- body has not been built yet. if Ekind (Old_S) in E_Function | E_Procedure and then Nkind (Decl) = N_Subprogram_Declaration and then not Is_Generic_Instance (Old_S) - and then not GNATprove_Mode then Set_Body_To_Inline (Decl, Old_S); end if; -- 2.34.1