Commit 6669dbdf by Paul Thomas

re PR fortran/34558 (ICE with same TYPE in both program and interface)

2007-12-31  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/34558
	* interface.c (gfc_compare_types): Prevent linked lists from
	putting this function into an endless recursive loop.

2007-12-31  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/34558
	* gfortran.dg/linked_list_1.f90: New test.

From-SVN: r131239
parent 63287e10
...@@ -407,17 +407,19 @@ gfc_compare_derived_types (gfc_symbol *derived1, gfc_symbol *derived2) ...@@ -407,17 +407,19 @@ gfc_compare_derived_types (gfc_symbol *derived1, gfc_symbol *derived2)
if (dt1->dimension && gfc_compare_array_spec (dt1->as, dt2->as) == 0) if (dt1->dimension && gfc_compare_array_spec (dt1->as, dt2->as) == 0)
return 0; return 0;
/* Make sure that link lists do not put this function in an /* Make sure that link lists do not put this function into an
endless loop! */ endless recursive loop! */
if (!(dt1->ts.type == BT_DERIVED && derived1 == dt1->ts.derived) if (!(dt1->ts.type == BT_DERIVED && derived1 == dt1->ts.derived)
&& !(dt1->ts.type == BT_DERIVED && derived1 == dt1->ts.derived) && !(dt1->ts.type == BT_DERIVED && derived1 == dt1->ts.derived)
&& gfc_compare_types (&dt1->ts, &dt2->ts) == 0) && gfc_compare_types (&dt1->ts, &dt2->ts) == 0)
return 0; return 0;
else if (dt1->ts.type != BT_DERIVED else if ((dt1->ts.type == BT_DERIVED && derived1 == dt1->ts.derived)
|| derived1 != dt1->ts.derived && !(dt1->ts.type == BT_DERIVED && derived1 == dt1->ts.derived))
|| dt2->ts.type != BT_DERIVED return 0;
|| derived2 != dt2->ts.derived)
else if (!(dt1->ts.type == BT_DERIVED && derived1 == dt1->ts.derived)
&& (dt1->ts.type == BT_DERIVED && derived1 == dt1->ts.derived))
return 0; return 0;
dt1 = dt1->next; dt1 = dt1->next;
......
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