public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Marc Poulhiès" <poulhies@adacore.com>
To: gcc-patches@gcc.gnu.org
Cc: Eric Botcazou <ebotcazou@adacore.com>
Subject: [COMMITTED] ada: Revert latest change to Find_Hook_Context
Date: Thu, 15 Jun 2023 10:04:24 +0200	[thread overview]
Message-ID: <20230615080424.939984-1-poulhies@adacore.com> (raw)

From: Eric Botcazou <ebotcazou@adacore.com>

The issue is that, if an aggregate is both below a conditional expression
and above another conditional expression in the tree, we have currently no
place to put the finalization actions generated by the innermost expression
in the context of the aggregate before it is expanded, so they end up being
placed after the outermost expression.

But it is not clear whether that's really problematic because this does not
seem to happen for array aggregates with multiple or others choices: in this
case the aggregate is expanded first and the code path is not taken.

gcc/ada/

	* exp_util.adb (Find_Hook_Context): Revert latest change.

Tested on x86_64-pc-linux-gnu, committed on master.

---
 gcc/ada/exp_util.adb | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb
index a4aa5f64447..91959793638 100644
--- a/gcc/ada/exp_util.adb
+++ b/gcc/ada/exp_util.adb
@@ -6500,16 +6500,6 @@ package body Exp_Util is
             then
                Top := Par;
 
-            --  Stop at contexts where temporaries may be contained
-
-            elsif Nkind (Par) in N_Aggregate
-                               | N_Delta_Aggregate
-                               | N_Extension_Aggregate
-                               | N_Block_Statement
-                               | N_Loop_Statement
-            then
-               exit;
-
             --  Prevent the search from going too far
 
             elsif Is_Body_Or_Package_Declaration (Par) then
-- 
2.40.0


                 reply	other threads:[~2023-06-15  8:04 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=20230615080424.939984-1-poulhies@adacore.com \
    --to=poulhies@adacore.com \
    --cc=ebotcazou@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    /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).