https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88124
--- Comment #5 from Steve Kargl <sgk at troutmask dot apl.washington.edu> --- On Wed, Nov 21, 2018 at 03:57:05AM +0000, kargl at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88124 > > --- Comment #4 from kargl at gcc dot gnu.org --- > (In reply to kargl from comment #3) > > I think you're running into undefined behavior. Even though > > the derive type defined in the include file is obviously > > identical when the main program and subroutine are in > > different files and the file is INCLUDEd and therefore > > compiled separately, these are different types. The > > namespaces for the main program and the subroutine are > > different. > > PS: INCLUDE is not a substitute for MODULE. > PPS: I think the code when in separate files is non-conforming as the types are different and therefore the call to the subroutine in the main program has a type mismatch. gfortran is not required to diagnosis this mismatch as the subroutine has an implicit interface.