From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0BD313858D34; Mon, 1 Apr 2024 11:38:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0BD313858D34 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1711971496; bh=hF3xPd/rlKnkCIrT2W4lwwsBVkS4Fj4L4WzCAMWmB3U=; h=From:To:Subject:Date:In-Reply-To:References:From; b=nTLt8zbZ4KYggwf6YAibWHCD790mOrCwsPOzKKO3hHbLcelipqSKGPNSSkhLIqE2J eCbYkYP35g3M5yLGpro1UsaWQpyeuvY9TOg3ml0hgiN3ukpbqBSew/i/zMdIDUIVbY Gq/f8E6wnubzbemNjCP+6jZiSUtFaSKy5uAaV+sA= From: "pault at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/114535] [13/14 regression] ICE with elemental finalizer Date: Mon, 01 Apr 2024 11:38:14 +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: 14.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: P3 X-Bugzilla-Assigned-To: pault at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114535 --- Comment #4 from Paul Thomas --- Created attachment 57839 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D57839&action=3Dedit "Fix" for this PR Even though no entities of type 'vs' are being referenced in subroutine iss, gfortran currently feels the need to generate a final wrapper for it. The comment in the patch explains what is happening but not why. I suspect that= the evil is being done somewhere in resolve.cc and will investigate in another session. Note the comments in the testcase below: module d implicit none contains function en() result(dd) use :: iv implicit none type(vs) :: dd dd%i =3D 1 end function en end module d ! Comment out line 1 and all brands complain that 'vs' is an undefined type ! Comment out line 1 and line 2 allows compilation to proceed (with fix for gfortran) module ni implicit none contains subroutine iss() use :: iv ! line 1 use :: d implicit none type(vs) :: ans; ans =3D en(); print *, ctr, ans%i ! line 2 end subroutine iss end module ni use ni call iss() call iss() ! print *, ctr end=