Commit 9f23af48 by Mikael Morin

re PR fortran/45916 (ICE in match_procedure_in_type, at fortran/decl.c:7921)

2010-10-07  Mikael Morin  <mikael@gcc.gnu.org>

	PR fortran/45916
	Revert revision 165026:
	2010-10-06  Mikael Morin  <mikael@gcc.gnu.org>

	* decl.c (match_procedure_in_type): Assertify if conditions.

2010-10-07  Mikael Morin  <mikael@gcc.gnu.org>

	PR fortran/45916
	* gfortran.dg/generic_typebound_operator_1.f90: New test.

From-SVN: r165089
parent fa8d6f07
2010-10-07 Mikael Morin <mikael@gcc.gnu.org>
PR fortran/45916
Revert revision 165026:
2010-10-06 Mikael Morin <mikael@gcc.gnu.org>
* decl.c (match_procedure_in_type): Assertify if conditions.
2010-10-06 Jerry DeLisle <jvdelisle@gcc.gnu.org> 2010-10-06 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/45889 PR fortran/45889
......
...@@ -7916,9 +7916,8 @@ match_procedure_in_type (void) ...@@ -7916,9 +7916,8 @@ match_procedure_in_type (void)
would be an error. If a GENERIC already targetted this binding, it may would be an error. If a GENERIC already targetted this binding, it may
be already there but then typebound is still NULL. */ be already there but then typebound is still NULL. */
stree = gfc_find_symtree (ns->tb_sym_root, name); 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 " gfc_error ("There is already a procedure with binding name '%s' for "
"the derived type '%s' at %C", name, block->name); "the derived type '%s' at %C", name, block->name);
return MATCH_ERROR; return MATCH_ERROR;
...@@ -7926,9 +7925,11 @@ match_procedure_in_type (void) ...@@ -7926,9 +7925,11 @@ match_procedure_in_type (void)
/* Insert it and set attributes. */ /* Insert it and set attributes. */
gcc_assert (!stree); if (!stree)
{
stree = gfc_new_symtree (&ns->tb_sym_root, name); stree = gfc_new_symtree (&ns->tb_sym_root, name);
gcc_assert (stree); gcc_assert (stree);
}
stree->n.tb = gfc_get_typebound_proc (&tb); stree->n.tb = gfc_get_typebound_proc (&tb);
if (gfc_get_sym_tree (target, gfc_current_ns, &stree->n.tb->u.specific, if (gfc_get_sym_tree (target, gfc_current_ns, &stree->n.tb->u.specific,
......
2010-10-07 Mikael Morin <mikael@gcc.gnu.org>
PR fortran/45916
* gfortran.dg/generic_typebound_operator_1.f90: New test.
2010-10-06 Jerry DeLisle <jvdelisle@gcc.gnu.org> 2010-10-06 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/45889 PR fortran/45889
......
! { 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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment