From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2EDA03858D39; Wed, 8 Feb 2023 20:10:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2EDA03858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675887049; bh=O5N54BvyzdHElRGM8SFgjesXVF5w1mwju5YLkXt5NnM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=wp+/ifTUxfDaGJYbX1Xr190YatsgcNi4kO5lxGaXQFut6CLn6JR9ZUrg79NGiMXgi 4ZKYNTC6kEkw0wCzvkpueM/spEVX7fLPv3cClqtSc8pRrFESJGW2zuD+qGvXyrkQcn 73v9QbI3Awe/22PhKOuDK0qyJnGOxiKcgIc9utFw= From: "anlauf at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/69636] ICE(s) on using option -fmodule-private Date: Wed, 08 Feb 2023 20:10:47 +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: 6.0 X-Bugzilla-Keywords: error-recovery, 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: P3 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=3D69636 --- Comment #8 from anlauf at gcc dot gnu.org --- A slightly reduced & rewritten variant of the code in comment#6: module m implicit none private public :: cx, operator(+) private :: cx_plus_int ! <- why does this make a difference? type cx integer :: re end type interface operator (+) module procedure cx_plus_int end interface contains function cx_plus_int (z, r) entry int_plus_cx (r, z) ! <- why does this make a difference? type(cx), intent(in) :: z integer, intent(in) :: r type(cx) :: cx_plus_int, int_plus_cx cx_plus_int%re =3D z%re + r end function end module program p use m type(cx) :: a =3D cx(1) print *, (a + 2) end So there are multiple issues at work: - the explicit "private :: cx_plus_int" should not make a difference; I think I've seen a related PR - adding an entry that is otherwise unused changes the module - the modified module when read seems to obstruct finding cx_plus_int, although the symbols still appears to be there...=