From: "Marc Poulhiès" <poulhies@adacore.com>
To: gcc-patches@gcc.gnu.org
Cc: Piotr Trojanek <trojanek@adacore.com>
Subject: [COMMITTED] ada: Remove unhelpful special case for renamed bodies in GNATprove mode
Date: Thu, 5 Jan 2023 15:40:55 +0100 [thread overview]
Message-ID: <20230105144055.156446-1-poulhies@adacore.com> (raw)
From: Piotr Trojanek <trojanek@adacore.com>
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
reply other threads:[~2023-01-05 14:40 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230105144055.156446-1-poulhies@adacore.com \
--to=poulhies@adacore.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=trojanek@adacore.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).