diff options
Diffstat (limited to 'gcc/fortran/interface.c')
-rw-r--r-- | gcc/fortran/interface.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c index 717f3b7..519251e 100644 --- a/gcc/fortran/interface.c +++ b/gcc/fortran/interface.c @@ -407,17 +407,19 @@ gfc_compare_derived_types (gfc_symbol *derived1, gfc_symbol *derived2) if (dt1->dimension && gfc_compare_array_spec (dt1->as, dt2->as) == 0) return 0; - /* Make sure that link lists do not put this function in an - endless loop! */ + /* Make sure that link lists do not put this function into an + endless recursive loop! */ if (!(dt1->ts.type == BT_DERIVED && derived1 == dt1->ts.derived) && !(dt1->ts.type == BT_DERIVED && derived1 == dt1->ts.derived) && gfc_compare_types (&dt1->ts, &dt2->ts) == 0) return 0; - else if (dt1->ts.type != BT_DERIVED - || derived1 != dt1->ts.derived - || dt2->ts.type != BT_DERIVED - || derived2 != dt2->ts.derived) + else if ((dt1->ts.type == BT_DERIVED && derived1 == dt1->ts.derived) + && !(dt1->ts.type == BT_DERIVED && derived1 == dt1->ts.derived)) + return 0; + + else if (!(dt1->ts.type == BT_DERIVED && derived1 == dt1->ts.derived) + && (dt1->ts.type == BT_DERIVED && derived1 == dt1->ts.derived)) return 0; dt1 = dt1->next; |