https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66973
--- 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: > > USE H5T > USE ISO_C_BINDING > > differs from > > USE ISO_C_BINDING > USE H5T > > 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 ...