diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2009-08-17 20:17:12 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2009-08-17 20:17:12 +0000 |
commit | 1151ccc922e195087ce596ac58a09a113e58011b (patch) | |
tree | 07fdaa9450f0ab8128378fe6f6c2252efff5a683 /gcc | |
parent | e83fd9d7f5fde2a813400775357a30cdbdfd8cdc (diff) | |
download | gcc-1151ccc922e195087ce596ac58a09a113e58011b.zip gcc-1151ccc922e195087ce596ac58a09a113e58011b.tar.gz gcc-1151ccc922e195087ce596ac58a09a113e58011b.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/trans-decl.c | 8 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/use_only_4.f90 | 34 |
4 files changed, 52 insertions, 1 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 10f95fb..cf5b4ec 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -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 diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index 3cc7903..7fb571f 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -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 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7c905d7..8a05c84 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 diff --git a/gcc/testsuite/gfortran.dg/use_only_4.f90 b/gcc/testsuite/gfortran.dg/use_only_4.f90 new file mode 100644 index 0000000..a37db45 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/use_only_4.f90 @@ -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" } } |