From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CD20F3857C74; Mon, 4 Dec 2023 10:05:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CD20F3857C74 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1701684301; bh=QxCbQ6Xgyc9MztUR2QdVq73jFjnOsL7kpJVrKVUSwB0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=vqXaS6oAEMKLGfr06ptcsZccoiKIcQ/JsVfsk4u946fvvehmXgfMAIjxc01iQVg30 JPMQhxitHXuVBth9yriWj4nVrDgT6UqtYq40UwP4HnDs8haW588RwsWth+qouTGFTR 0neEEjYptICH3402+yATNBFv74t4rIcjq86oud0g= From: "ebotcazou at gcc dot 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ada X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ebotcazou at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: ebotcazou at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: resolution bug_status Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D112461 Eric Botcazou changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|ASSIGNED |RESOLVED --- Comment #2 from Eric Botcazou --- https://gcc.gnu.org/g:f6bbf84ec759f203251c6c5a0dec8344f17cc614 commit r14-5909-gf6bbf84ec759f203251c6c5a0dec8344f17cc614 Author: Eric Botcazou 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 ta= ken, 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.=