From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E27523858D33; Tue, 20 Feb 2024 20:48:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E27523858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1708462103; bh=4/6TmSnKfQ17gmp1kUowvXYgUwwuxB1BYb4dfpoLJMw=; h=From:To:Subject:Date:From; b=QscsuLkTi+h8sNVLKFwPJ7cWpvyuAF/d55dLbP7uZ3LRc/13P771BYoWREzlShDgH nN9cnAJyVqmHz2xkCt7LH19Fxw2ktgcM5826L/oqRRdOctScIW98++v7+J1d1cc0Zh ISCsw5jH+RZMqaeeD0IG71tfJFe1zZxiZZ6eo7CU= From: "kargl at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/114020] New: ENTRY and procedure pointer leads to ICE Date: Tue, 20 Feb 2024 20:48:23 +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: kargl 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=3D114020 Bug ID: 114020 Summary: ENTRY and procedure pointer leads to ICE Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: kargl at gcc dot gnu.org Target Milestone: --- Found with the Fujitsu testsuite. Reduced testcase. Note, if the use of ENTRY is replace with an actual=20 function, ie., 'function kmr_fixfun() result(zz)" the code compiles and executes correctly. ! ! https://github.com/fujitsu/compiler-test-suite ! Reduced from Fortran/0071/0071_0018.f90 ! module xxxf contains subroutine sub end subroutine function kmr_fixfun2() result(zz) entry kmr_fixfun() result(zz) procedure(sub), pointer :: zz zz =3D> null() end function=20 integer function foo() result(zz) procedure(sub), pointer :: fp fp =3D> kmr_fixfun() zz =3D 0 end function foo end module xxxf use xxxf if (foo() /=3D 0) stop end % gfcx -o z 0071/0071_0018.f90 0071/0071_0018.f90:8:3: 8 | function kmr_fixfun2() result(zz) | ^ internal compiler error: in fold_convert_loc, at fold-const.cc:2633 0x741511 fold_convert_loc(unsigned int, tree_node*, tree_node*) ../../gccx/gcc/fold-const.cc:2633 0xd650c9 gimplify_modify_expr ../../gccx/gcc/gimplify.cc:6356 0xd4e52c gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*= ), int)=