re PR fortran/41062 (ICE in gfc_trans_use_stmts, at fortran/trans-decl.c:3438)

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.

2008-08-17  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/41062
	* gfortran.dg/use_only_4.f90: New test.

From-SVN: r150858
This commit is contained in:
Paul Thomas 2009-08-17 20:17:12 +00:00
parent e83fd9d7f5
commit 1151ccc922
4 changed files with 52 additions and 1 deletions

View File

@ -1,3 +1,9 @@
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

View File

@ -3426,7 +3426,13 @@ gfc_trans_use_stmts (gfc_namespace * ns)
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

View File

@ -1,3 +1,8 @@
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

View File

@ -0,0 +1,34 @@
! { 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" } }