I've committed the attached patch as obvious after testing on x86_64-*-freebsd. The short story is that gfortran tracks the number of ENTRY symbols with a reference count. If an ENTRY was included in a routine within a MODULE the reference count was not properly increment. This patch now does the increment. As a bonus it fixes a nearby comment that is missing a space, and changes the only occurence of ++sym->refs to sym->refs++ for consistency. 2015-11-12 Steven G. Kargl PR fortran/68318 * decl.c (get_proc_name): Increment reference count for ENTRY. While here, fix comment and use postfix ++ for consistency. 2015-11-12 Steven G. Kargl PR fortran/68318 * gfortran.dg/pr68318_1.f90: New test. * gfortran.dg/pr68318_2.f90: Ditto. -- Steve