https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63797
--- Comment #7 from Steve Kargl <sgk at troutmask dot apl.washington.edu> --- On Wed, Apr 14, 2021 at 08:43:50PM +0000, anlauf at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63797 > > --- Comment #6 from anlauf at gcc dot gnu.org --- > Steve, can you give an example for the procedure pointer case you mentioned? > I played a bit, but the only valid code that I can think of did not produce > a reference to sqrt in such a way that it needs to show up in the mod. > > Extended testcase that compiles and also uses a procedure pointer to sqrt(): > Your testcase is what I first thought about, but didn't try to write. The only other instance that I might be concerned about is module aaa abstract interface function real_func (x) real :: real_func real, intent (in) :: x end function real_func end interface procedure(real_func), pointer :: bah => sqrt end module aaa which looks like a default initialization. Does sqrt need to be recorded into the module? If not, then your patch is probably ok.