http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46196

--- Comment #5 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2010-10-28 
21:06:36 UTC ---
> Maybe you could check if there are any 'false alarm' errors among that ...

I'll do it. Meanwhile I am puzzled by the patch. My understanding of
compare_type_rank and compare_type_rank_if is that these tests should be
symmetric: test(A,B)==test(B,A). So if test(A,B)||test(B,A) changes something
it means that the tests are actually asymmetric. This asymmetry seems buggy.
Looking at gcc/fortran/interface.c, I see at lines 447 to 458:

      if (!(dt1->ts.type == BT_DERIVED && derived1 == dt1->ts.u.derived)
            && !(dt1->ts.type == BT_DERIVED && derived1 == dt1->ts.u.derived)
            && gfc_compare_types (&dt1->ts, &dt2->ts) == 0)
        return 0;

      else if ((dt1->ts.type == BT_DERIVED && derived1 == dt1->ts.u.derived)
                && !(dt1->ts.type == BT_DERIVED && derived1 ==
dt1->ts.u.derived))
        return 0;

      else if (!(dt1->ts.type == BT_DERIVED && derived1 == dt1->ts.u.derived)
                && (dt1->ts.type == BT_DERIVED && derived1 ==
dt1->ts.u.derived))
        return 0;

Should not this be

      if (!(dt1->ts.type == BT_DERIVED && derived1 == dt1->ts.u.derived)
            && !(dt2->ts.type == BT_DERIVED && derived2 == dt2->ts.u.derived)
            && gfc_compare_types (&dt1->ts, &dt2->ts) == 0)
        return 0;

      else if ((dt1->ts.type == BT_DERIVED && derived1 == dt1->ts.u.derived)
                && !(dt2->ts.type == BT_DERIVED && derived2 ==
dt2->ts.u.derived))
        return 0;

      else if (!(dt1->ts.type == BT_DERIVED && derived1 == dt1->ts.u.derived)
                && (dt2->ts.type == BT_DERIVED && derived2 ==
dt2->ts.u.derived))
        return 0;

???

Reply via email to