From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1040B3858401; Wed, 12 Apr 2023 19:42:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1040B3858401 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1681328548; bh=UgFh3IUmuJE9quBaFBhRhvYukcSeMGwT4+Vp82MoI3c=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Hrx0PW7EC6YjtbGorjW/Zc1Fax5FEzlTJGYjlNlwrVP6Cq6koV3TtrfqGSud5Nmz+ 0e89L/bRrQvB0KAd8zCSAMtXTEC917N1MNi2wtkO/TISmdqFec1K6rzyhqpHfm8H1w gmhrbq6m0n+tnNbiar0GfJKsrd8hGL1heYa/HQhA= From: "anlauf at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/66973] Incorrect resolution of generic interface with TYPE(C_PTR) Date: Wed, 12 Apr 2023 19:42:27 +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: 4.9.2 X-Bugzilla-Keywords: 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=3D66973 --- Comment #8 from anlauf at gcc dot gnu.org --- (In reply to anlauf from comment #7) > The behavior also depends on the order of USE statements in the main: >=20 > USE H5T > USE ISO_C_BINDING >=20 > differs from >=20 > USE ISO_C_BINDING > USE H5T >=20 > which should not happen... A workaround is to use a temporary of type(c_ptr) for the actual argument: type(c_ptr) :: ptr CALL pickone(ptr) This works for me. Possibly the issue is with the resolution of (the type of?) C_LOC ...=