From: mikael Date: Thu, 7 Oct 2010 10:46:58 +0000 (+0000) Subject: 2010-10-07 Mikael Morin X-Git-Tag: upstream/4.9.2~26055 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e204cb62ce95b12cba4809351a36d181ef5af1bd;p=platform%2Fupstream%2Flinaro-gcc.git 2010-10-07 Mikael Morin PR fortran/45916 Revert revision 165026: 2010-10-06 Mikael Morin * decl.c (match_procedure_in_type): Assertify if conditions. 2010-10-07 Mikael Morin PR fortran/45916 * gfortran.dg/generic_typebound_operator_1.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165089 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index db563e9..18e4dd9 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,11 @@ +2010-10-07 Mikael Morin + + PR fortran/45916 + Revert revision 165026: + 2010-10-06 Mikael Morin + + * decl.c (match_procedure_in_type): Assertify if conditions. + 2010-10-06 Jerry DeLisle PR fortran/45889 diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 3b01d39..5b4ab18 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -7916,9 +7916,8 @@ match_procedure_in_type (void) would be an error. If a GENERIC already targetted this binding, it may be already there but then typebound is still NULL. */ stree = gfc_find_symtree (ns->tb_sym_root, name); - if (stree) + if (stree && stree->n.tb) { - gcc_assert (stree->n.tb); gfc_error ("There is already a procedure with binding name '%s' for " "the derived type '%s' at %C", name, block->name); return MATCH_ERROR; @@ -7926,9 +7925,11 @@ match_procedure_in_type (void) /* Insert it and set attributes. */ - gcc_assert (!stree); - stree = gfc_new_symtree (&ns->tb_sym_root, name); - gcc_assert (stree); + if (!stree) + { + stree = gfc_new_symtree (&ns->tb_sym_root, name); + gcc_assert (stree); + } stree->n.tb = gfc_get_typebound_proc (&tb); if (gfc_get_sym_tree (target, gfc_current_ns, &stree->n.tb->u.specific, diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 441e565..bedc124 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-10-07 Mikael Morin + + PR fortran/45916 + * gfortran.dg/generic_typebound_operator_1.f90: New test. + 2010-10-06 Jerry DeLisle PR fortran/45889 diff --git a/gcc/testsuite/gfortran.dg/generic_typebound_operator_1.f90 b/gcc/testsuite/gfortran.dg/generic_typebound_operator_1.f90 new file mode 100644 index 0000000..76c15e9 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/generic_typebound_operator_1.f90 @@ -0,0 +1,19 @@ +! { dg-do compile } +! +! PR fortran/45916 +! ICE with generic type-bound operator + +module m_sort + implicit none + type, abstract :: sort_t + contains + generic :: operator(.gt.) => gt_cmp + procedure(gt_cmp), deferred :: gt_cmp + end type sort_t + interface + logical function gt_cmp(a,b) + import + class(sort_t), intent(in) :: a, b + end function gt_cmp + end interface +end module m_sort