From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 83F5D3858C50; Sat, 18 Mar 2023 16:26:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 83F5D3858C50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1679156816; bh=JrJOS5s0y+r20S2PrZDGOefor6vPh0FATR7RNpUq/+8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=NWQ4hAeAQzPsYIJPBfioK3VVtLcteHYlBoLnzwVNJTnxFZqCeRyeBWueAgSSUFDt0 pSk3xCZd3C5dvPoEOZNP1SlUHp95rtEKAMwl/an9AvwLoZtExANC9Z6hpTPEiC6Lpc XJbJy/FB0fNVl96a64UPXu/vNOcryjlScSxoNZdA= From: "pault at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/91316] Derived type finalization failing Date: Sat, 18 Mar 2023 16:26:56 +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: 9.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pault at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: unassigned 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D91316 --- Comment #5 from Paul Thomas --- Hi Jose, This is fixed to the extent that it behaves in the same way as ifort. nagfor, on the other hand, gives: [pault@pc30 pr37336]$ rm ./a.out;nagfor pr91316.f90 -g;./a.out NAG Fortran Compiler Release 7.1(Hanzomon) Build 7115 Error: pr91316.f90, line 39: Finaliser FINAL_END for INTENT(OUT) dummy THIS (no. 1) of pure procedure FINAL_INIT is not pure Errors in declarations, no further processing for FINAL_INIT Error: pr91316.f90, line 48: Rank 0 type FINAL_T result variable of pure function FINAL_SET will invoke an impure final subroutine Errors in declarations, no further processing for FINAL_SET Malcolm Cohen has convinced me that this error is correct. Setting the elemental functions to be impure recovers the expected behaviour with nagfor. I will keep this PR open as a place holder for this nit. Regards Paul=