http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44265
--- Comment #3 from Ian Harvey <ian_harvey at bigpond dot com> 2010-10-29 23:32:29 UTC --- (In reply to comment #2) > Created attachment 22202 [details] > Possible patch for PR44265 Apologies - I wrote several paragraphs of reasonably coherent explanation, but it got lost when I added the attachment. The attached set of patches introduces a new flag for gfc_symbol that is used to indicate when an entity is referenced in a specification expression for a function result; testing of that condition for module procedure local entities and setting of the flag in resolve.c; and changes to the assembly associated with the entity such that the object code for calling procedures in other program units can reference the entity. The test for the need to export the entity is probably too inclusive. The assembly name for the entity is of the form __modname_MOD__procname_PROC_entityname. Note that ->module for a gfc_symbol for a module procedure entity can either be NULL (when the hosting module is being compiled) or a zero length string (when a program unit that USE's the module is being compiled). I am not sure whether that is by design or accident - I have assumed by design. Perhaps Tobias had alternative approaches in mind but I am not familiar enough with the gfortran sources to know what he was talking about. This does not fix the failed assertion around a non-null ->tlink when a subroutine has an argument whose length uses such a specification expression.