Commit 0175478d by Jerry DeLisle

re PR fortran/42684 (ICE when interface operator(xx) available through host and…

re PR fortran/42684 (ICE when interface operator(xx) available through host and use assoc in module procedure)

2010-01-14 Jerry DeLisle <jvdelisle@gcc.gnu.org>

	PR fortran/42684
	* interface.c (check_interface1): Pass symbol name rather than NULL to
	gfc_compare_interfaces.	(gfc_compare_interfaces): Add assert to
	trap MULL.
	* resolve.c (check_generic_tbp_ambiguity): Pass symbol name rather
	than NULL to gfc_compare_interfaces.

From-SVN: r155930
parent ab693460
2010-01-14 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/42684
* interface.c (check_interface1): Pass symbol name rather than NULL to
gfc_compare_interfaces. (gfc_compare_interfaces): Add assert to
trap MULL.
* resolve.c (check_generic_tbp_ambiguity): Pass symbol name rather
than NULL to gfc_compare_interfaces.
2010-01-14 Paul Thomas <pault@gcc.gnu.org> 2010-01-14 Paul Thomas <pault@gcc.gnu.org>
PR fortran/41478 PR fortran/41478
......
...@@ -955,6 +955,8 @@ gfc_compare_interfaces (gfc_symbol *s1, gfc_symbol *s2, const char *name2, ...@@ -955,6 +955,8 @@ gfc_compare_interfaces (gfc_symbol *s1, gfc_symbol *s2, const char *name2,
{ {
gfc_formal_arglist *f1, *f2; gfc_formal_arglist *f1, *f2;
gcc_assert (name2 != NULL);
if (s1->attr.function && (s2->attr.subroutine if (s1->attr.function && (s2->attr.subroutine
|| (!s2->attr.function && s2->ts.type == BT_UNKNOWN || (!s2->attr.function && s2->ts.type == BT_UNKNOWN
&& gfc_get_default_type (name2, s2->ns)->type == BT_UNKNOWN))) && gfc_get_default_type (name2, s2->ns)->type == BT_UNKNOWN)))
...@@ -1126,7 +1128,7 @@ check_interface1 (gfc_interface *p, gfc_interface *q0, ...@@ -1126,7 +1128,7 @@ check_interface1 (gfc_interface *p, gfc_interface *q0,
if (p->sym->name == q->sym->name && p->sym->module == q->sym->module) if (p->sym->name == q->sym->name && p->sym->module == q->sym->module)
continue; continue;
if (gfc_compare_interfaces (p->sym, q->sym, NULL, generic_flag, 0, if (gfc_compare_interfaces (p->sym, q->sym, q->sym->name, generic_flag, 0,
NULL, 0)) NULL, 0))
{ {
if (referenced) if (referenced)
......
...@@ -9712,7 +9712,7 @@ check_generic_tbp_ambiguity (gfc_tbp_generic* t1, gfc_tbp_generic* t2, ...@@ -9712,7 +9712,7 @@ check_generic_tbp_ambiguity (gfc_tbp_generic* t1, gfc_tbp_generic* t2,
} }
/* Compare the interfaces. */ /* Compare the interfaces. */
if (gfc_compare_interfaces (sym1, sym2, NULL, 1, 0, NULL, 0)) if (gfc_compare_interfaces (sym1, sym2, sym2->name, 1, 0, NULL, 0))
{ {
gfc_error ("'%s' and '%s' for GENERIC '%s' at %L are ambiguous", gfc_error ("'%s' and '%s' for GENERIC '%s' at %L are ambiguous",
sym1->name, sym2->name, generic_name, &where); sym1->name, sym2->name, generic_name, &where);
......
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