http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46244
--- Comment #3 from janus at gcc dot gnu.org 2010-10-30 15:04:29 UTC --- The test case in comment #1 can be fixed by: Index: gcc/fortran/interface.c =================================================================== --- gcc/fortran/interface.c (revision 166089) +++ gcc/fortran/interface.c (working copy) @@ -424,6 +424,11 @@ gfc_compare_derived_types (gfc_symbol *derived1, g match. */ for (;;) { + if (dt1 == NULL && dt2 == NULL) + break; + if (dt1 == NULL || dt2 == NULL) + return 0; + if (strcmp (dt1->name, dt2->name) != 0) return 0; @@ -459,11 +464,6 @@ gfc_compare_derived_types (gfc_symbol *derived1, g dt1 = dt1->next; dt2 = dt2->next; - - if (dt1 == NULL && dt2 == NULL) - break; - if (dt1 == NULL || dt2 == NULL) - return 0; } return 1;