From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0B9B6389364C; Tue, 12 Jan 2021 13:03:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0B9B6389364C From: "drikosev at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/64290] [F03] No finalization at deallocation of LHS Date: Tue, 12 Jan 2021 13:03:38 +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: 5.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: drikosev at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: pault at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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: Tue, 12 Jan 2021 13:03:39 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D64290 --- Comment #4 from Ev Drikos --- Hello, There are some open PRs related to elemental finalisers. Having seen how you reallocate arrays, I'd the impression that the functionality for polymorphic entities would had a similar design. As one may also need ie to reset at least the '_len' field, ie class(*) x; x=3D'a'; Which in turn may not cause regressions to "finalize_25.f90" and I see that this test counts some finalisation calls. Of course I don't doubt that finalization may be partially implemented as you say. Admittedly the interpretation of 10.2.1.3 & 7.5.6.3 seems to be a herculean task. To my understanding, an outcome of the discussion in c.l.f is that the reallocation takes place if the LHS & RHS have different runtime types, at least this seems to be a criterion for no rank polymorphic entities. Hope this helps, Ev. Drikos=