This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
Hi all, here is a fix for a regression, which was introduced by r148519. With this revision I implemented better error messages for interface checks, with the side effect that I changed the order of some checks in gfc_compare_interfaces. The ICE here comes about because 'count_types_test' is called only after 'generic_correspondence', and the patch reverts this to its original order. It also makes sure 'count_types_test' is only called for generic interfaces (since 14.1.2.3 in the F95 standard only applies to generic interfaces). The testsuite yields no failures with this patch on x86_64-unknown-linux-gnu. Ok for trunk? Cheers, Janus 2009-07-26 Janus Weil <janus@gcc.gnu.org> PR fortran/40848 * interface.c (gfc_compare_interfaces): Call 'count_types_test' before 'generic_correspondence', and only if checking a generic interface. 2009-07-26 Janus Weil <janus@gcc.gnu.org> PR fortran/40848 * gfortran.dg/altreturn_7.f90: New.
Index: gcc/fortran/interface.c =================================================================== --- gcc/fortran/interface.c (revision 150097) +++ gcc/fortran/interface.c (working copy) @@ -983,6 +983,8 @@ gfc_compare_interfaces (gfc_symbol *s1, if (generic_flag) { + if (count_types_test (f1, f2) || count_types_test (f2, f1)) + return 0; if (generic_correspondence (f1, f2) || generic_correspondence (f2, f1)) return 0; } @@ -1034,13 +1036,6 @@ gfc_compare_interfaces (gfc_symbol *s1, f2 = f2->next; } - if (count_types_test (f1, f2) || count_types_test (f2, f1)) - { - if (errmsg != NULL) - snprintf (errmsg, err_len, "Interface not matching"); - return 0; - } - return 1; }
Attachment:
altreturn_7.f90
Description: Binary data
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |