From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1C6383858C54; Sat, 13 Aug 2022 16:09:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1C6383858C54 From: "tkoenig at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/106576] Finalization of temporaries from functions not occuring Date: Sat, 13 Aug 2022 16:09:26 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: tkoenig at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: tkoenig at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: everconfirmed assigned_to cf_reconfirmed_on bug_status attachments.created 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2022 16:09:27 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106576 Thomas Koenig changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Assignee|unassigned at gcc dot gnu.org |tkoenig at gcc dot = gnu.org Last reconfirmed| |2022-08-13 Status|UNCONFIRMED |ASSIGNED --- Comment #2 from Thomas Koenig --- Created attachment 53451 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D53451&action=3Dedit Concept patch to show where stuff can be added (finding the cases only) Here's a raw concept patch which shows (via fprintf) where the work could be done. The idea is to look at the statement (and nothing else) and then create a finalization block around it if there is something to finalize. When creating the temporary with gfc_create_var, it probably would make sense to add it to the symbols of the block as well and add it to the routines to be finalized. How does that sound?=