From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8DF293858282; Mon, 8 Apr 2024 19:03:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8DF293858282 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1712602997; bh=vvPjGkt5fRQvs3E9Wf0yZnPMf8BL+ASE1N9pxLyHaGw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=LRntQqTbc+1sv7JyMcX+atl19RaBs19cGgDN3Tr8iaG6Si/rMeUFgWoMIcW/B8LMQ wnHQPFjTbMVQMAPWm6Romn/qtw+JnbZhtuiOXATs1NcFHOAi/Rvd+GoCQRBhAnA6Ev S2lnHMwiDZKA3y2D5WgSL1u2GGIxMj5jcXOeMgA8= From: "anlauf at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/106500] ICE on function as an argument to c_sizeof() Date: Mon, 08 Apr 2024 19:03:16 +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: 12.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: anlauf 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=3D106500 --- Comment #5 from anlauf at gcc dot gnu.org --- (In reply to anlauf from comment #4) > What is unclear to me: when is an expression interoperable? > Or rather when is it *not*? >=20 > (Note that the standard text has not essentially changed since F2008, > so we got this too strict from the beginning.) Actually the following interp is very helpful: https://j3-fortran.org/doc/year/22/22-101r1.txt And while working on a fix, I found the following invalid code ICEing: subroutine s () use, intrinsic :: iso_c_binding implicit none type(c_ptr) :: cPtr call c_f_pointer (cPtr, p0) ! { dg-error "function returning a pointer" } call c_f_pointer (cPtr, p1, shape=3D[2]) ! { dg-error "function returning= a pointer" } contains function p0 () integer, pointer :: p0 nullify (p0) end function p1 () integer, pointer :: p1(:) nullify (p1) end end=