http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46067
--- Comment #3 from janus at gcc dot gnu.org 2010-10-18 21:29:31 UTC --- (In reply to comment #1) > > potential problem 2: if the error message is correct and if the type of the > > passed-object dummy argument in the sample code is changed from a > > declaration > > of "type" to "class", the module compiles but hangs when the passed-object > > dummy argument is referenced. > > After changing the PASS arg from TYPE to CLASS, the module compiles fine for > me > without any hanging (on x86_64-unknown-linux-gnu at r165600). I can confirm the runtime hanging on Mac OS. It happens for the original test case as well as for this reduction: implicit none type test_type procedure(fun1), pointer, pass :: fun_ptr end type test_type type(test_type) :: funs funs%fun_ptr => fun1 print *, " fun1(pi) ",funs%fun_ptr(0.) contains real function fun1 (t,x) real, intent(in) :: x class(test_type) :: t print *," in fun1 " fun1 = cos(x) end function fun1 end The reason seems to be the "recursive I/O" in the program, i.e. the fact that the call to 'fun_ptr'/'fun1' happens inside a PRINT statement, but 'fun1' itself contains another PRINT statement. I think I've seen this kind of behavior before on Darwin, though I'm not sure if the Fortran standard allows it or whether gfortran should actually reject it.