From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2AADD3858D32; Fri, 12 Jan 2024 20:31:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2AADD3858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1705091466; bh=WCxnEf7to012k5Vu8g4AdkFYhg9qG9q7ClRj8kG7lWU=; h=From:To:Subject:Date:From; b=gLzKKxoJ5tjJBfjbO9x3poF+QsYYwBezX+SMGzmpSEIUi/DjmDPtg9yNAcBEtUKyf BKlyBEUN8824Z0S/L1949/SsR7+WmpowA3p/MVPOxYciSazrLSwttyup+037yJcQBB 1Q+rjspJ4pkBV8UptgVnJDQPkTRUZaD30CYp42Co= From: "anlauf at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/113363] New: ICE on ASSOCIATE and unlimited polymorphic function Date: Fri, 12 Jan 2024 20:31:05 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new 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: anlauf at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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=3D113363 Bug ID: 113363 Summary: ICE on ASSOCIATE and unlimited polymorphic function Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: anlauf at gcc dot gnu.org Target Milestone: --- While discussing a patch for PR89645/99065, the following issue with ASSOCIATE and unlimited polymorphic functions was found: https://gcc.gnu.org/pipermail/fortran/2024-January/060098.html program p implicit none class(*), allocatable :: x(:) x =3D foo() call prt (x) deallocate (x) ! up to here all is fine... associate (var =3D> foo()) ! <- crash here call prt (var) ! <- or here end associate contains function foo() result(res) class(*), allocatable :: res(:) res =3D [42] end function foo subroutine prt (x) class(*), intent(in) :: x(:) select type (x) type is (integer) print *, x class default stop 99 end select end subroutine prt end This ICEs on current trunk for any of the indicated statements.=