It seems that code like a = obj%func () ! PROCEDURE, NOPASS :: func => target_func
misses some checks (for instance, that a and the result of func have the same rank) that are performed for the "equivalent" a = target_func () The attached test program not only misses a diagnostic for this, but ICEs. I've not yet looked in detail at the ICE, but I suppose it's very likely caused because it assumes that both ranks are equal or something like this and the assumption failed because no error was emitted for this. -- Summary: Checks when assigning from a type-bound procedure broken Product: gcc Version: unknown Status: UNCONFIRMED Keywords: ice-on-invalid-code Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: domob at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37429