https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120049
--- Comment #4 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
Vincent was able to reduce this further. Two files, gtk_sup.f90 and test.f90.
$ cat gtk_sup.f90
module gtk_sup
use, intrinsic :: iso_c_binding
end module gtk_sup
$ cat test.f90
program tests_gtk_sup
use gtk_sup
type(c_ptr), target :: val
! If you comment the following line, it compiles and runs:
print *, c_associated(val, c_loc(val))
end program tests_gtk_sup
$ gfc -c gtk_sup.f90
$ ls
gtk_sup.f90 gtk_sup.mod gtk_sup.o test.f90
$ gfc -c test.f90
f951: internal compiler error: gfc_typename(): Undefined type
0x694bce diagnostic_report_diagnostic(diagnostic_context*, diagnostic_info*)
../../trunk/gcc/diagnostic.h:1180
0x694bce gfc_report_diagnostic
../../trunk/gcc/fortran/error.cc:250
0x694bce gfc_internal_error(char const*, ...)
../../trunk/gcc/fortran/error.cc:834
0x6d5ecf gfc_typename(gfc_typespec*, bool)
../../trunk/gcc/fortran/misc.cc:218
0x66335a gfc_check_c_associated(gfc_expr*, gfc_expr*)
../../trunk/gcc/fortran/check.cc:5977
0x6aeb92 check_specific
../../trunk/gcc/fortran/intrinsic.cc:4971
0x6b7bb5 gfc_intrinsic_func_interface(gfc_expr*, int)
../../trunk/gcc/fortran/intrinsic.cc:5217
0x72626b resolve_unknown_f
...
Anyone have any thoughts?