+2008-08-17 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/41062
+ * trans-decl.c (gfc_trans_use_stmts): Keep going through use
+ list if symbol is not use associated.
+
2009-08-17 Daniel Kraft <d@domob.eu>
PR fortran/37425
st = gfc_find_symtree (ns->sym_root,
rent->local_name[0]
? rent->local_name : rent->use_name);
- gcc_assert (st && st->n.sym->attr.use_assoc);
+ gcc_assert (st);
+
+ /* Sometimes, generic interfaces wind up being over-ruled by a
+ local symbol (see PR41062). */
+ if (!st->n.sym->attr.use_assoc)
+ continue;
+
if (st->n.sym->backend_decl
&& DECL_P (st->n.sym->backend_decl)
&& st->n.sym->module
+2008-08-17 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/41062
+ * gfortran.dg/use_only_4.f90: New test.
+
2009-08-17 Daniel Kraft <d@domob.eu>
PR fortran/37425
--- /dev/null
+! { dg-do compile }
+! Test the fix for PR41062, in which an ICE would ensue because
+! of confusion between the two 'one's in the creation of module
+! debug info.
+!
+! Reported by Norman S. Clerman <clerman@fuse.net>
+! Reduced testcase by Tobias Burnus <burnus@gcc.gnu.org>
+!
+module m1
+ interface one ! GENERIC "one"
+ module procedure one1
+ end interface
+contains
+ subroutine one1()
+ call abort
+ end subroutine one1
+end module m1
+
+module m2
+use m1, only : one ! USE generic "one"
+contains
+ subroutine two()
+ call one() ! Call internal "one"
+ contains
+ subroutine one() ! Internal "one"
+ print *, "m2"
+ end subroutine one
+ end subroutine two
+end module m2
+
+ use m2
+ call two
+end
+! { dg-final { cleanup-modules "m1 m2" } }