re PR fortran/40848 (ICE with alternate returns)

2009-07-27  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-27  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/40848
	* gfortran.dg/altreturn_7.f90: New.

From-SVN: r150134
This commit is contained in:
Janus Weil 2009-07-27 20:26:34 +02:00
parent cf157324f3
commit e26f55480f
4 changed files with 47 additions and 7 deletions

View File

@ -1,3 +1,9 @@
2009-07-27 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-27 Tobias Burnus <burnus@net-b.de>
PR fortran/40851

View File

@ -983,6 +983,8 @@ gfc_compare_interfaces (gfc_symbol *s1, gfc_symbol *s2, int generic_flag,
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, gfc_symbol *s2, int generic_flag,
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;
}

View File

@ -1,3 +1,8 @@
2009-07-27 Janus Weil <janus@gcc.gnu.org>
PR fortran/40848
* gfortran.dg/altreturn_7.f90: New.
2009-07-27 Simon Baldwin <simonb@google.com>
PR testsuite/40829

View File

@ -0,0 +1,34 @@
! { dg-do compile }
!
! PR 40848: [4.5 Regression] ICE with alternate returns
!
! Contributed by Joost VandeVondele <jv244@cam.ac.uk>
MODULE TT
INTERFACE M
MODULE PROCEDURE M1,M2
END INTERFACE
CONTAINS
SUBROUTINE M1(I,*)
INTEGER :: I
RETURN 1
END SUBROUTINE
SUBROUTINE M2(I,J)
INTEGER :: I,J
END SUBROUTINE
END MODULE
USE TT
CALL M(1,*2)
CALL ABORT()
2 CONTINUE
END
! { dg-final { cleanup-modules "tt" } }