public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ebotcazou at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug ada/112461] [14 regression] premature finalization with nested return inside extended one
Date: Mon, 04 Dec 2023 10:05:00 +0000	[thread overview]
Message-ID: <bug-112461-4-SgYhORUYEe@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-112461-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112461

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #2 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
https://gcc.gnu.org/g:f6bbf84ec759f203251c6c5a0dec8344f17cc614

commit r14-5909-gf6bbf84ec759f203251c6c5a0dec8344f17cc614
Author: Eric Botcazou <ebotcazou@adacore.com>
Date:   Wed Nov 8 23:29:01 2023 +0100

    ada: Fix premature finalization for nested return within extended one

    The return object is incorrectly finalized when the nested return is taken,
    because the special flag attached to the return object is not updated.

    gcc/ada/
            * exp_ch6.adb (Build_Flag_For_Function): New function made up of
the
            code building the special flag for return object present...
            (Expand_N_Extended_Return_Statement): ...in there.  Replace the
code
            with a call to Build_Flag_For_Function.  Add assertion for the
flag.
            (Expand_Non_Function_Return): For a nested return, if the return
            object needs finalization actions, update the special flag.

      parent reply	other threads:[~2023-12-04 10:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-09 15:01 [Bug ada/112461] New: [14 regression] Simple return inside extended return loses updates to return object value simon at pushface dot org
2023-11-10  8:16 ` [Bug ada/112461] " rguenth at gcc dot gnu.org
2023-11-10 10:05 ` [Bug ada/112461] [14 regression] premature finalization with nested return inside extended one ebotcazou at gcc dot gnu.org
2023-11-10 10:06 ` ebotcazou at gcc dot gnu.org
2023-12-04 10:05 ` ebotcazou at gcc dot gnu.org [this message]

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=bug-112461-4-SgYhORUYEe@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).