mirror of git://gcc.gnu.org/git/gcc.git
re PR fortran/52668 (Incorrect unused warning for USE associating variable in common block)
2012-04-06 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/52668 * module.c: Only mark symbols as use_only if they have been imported via an only list. 2012-04-06 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/52668 * gfortran.dg/use_only_6.f90: New test. From-SVN: r186199
This commit is contained in:
parent
5f250b068e
commit
631cfe3083
|
@ -1,3 +1,9 @@
|
||||||
|
2012-04-06 Thomas Koenig <tkoenig@gcc.gnu.org>
|
||||||
|
|
||||||
|
PR fortran/52668
|
||||||
|
* module.c: Only mark symbols as use_only if they have been
|
||||||
|
imported via an only list.
|
||||||
|
|
||||||
2012-03-28 Paul Thomas <pault@gcc.gnu.org>
|
2012-03-28 Paul Thomas <pault@gcc.gnu.org>
|
||||||
Tobias Burnus <burnus@gcc.gnu.org>
|
Tobias Burnus <burnus@gcc.gnu.org>
|
||||||
|
|
||||||
|
|
|
@ -4389,9 +4389,24 @@ load_needed (pointer_info *p)
|
||||||
|
|
||||||
/* Mark as only or rename for later diagnosis for explicitly imported
|
/* Mark as only or rename for later diagnosis for explicitly imported
|
||||||
but not used warnings; don't mark internal symbols such as __vtab,
|
but not used warnings; don't mark internal symbols such as __vtab,
|
||||||
__def_init etc. */
|
__def_init etc. Only mark them if they have been explicitly loaded. */
|
||||||
|
|
||||||
if (only_flag && sym->name[0] != '_' && sym->name[1] != '_')
|
if (only_flag && sym->name[0] != '_' && sym->name[1] != '_')
|
||||||
sym->attr.use_only = 1;
|
{
|
||||||
|
gfc_use_rename *u;
|
||||||
|
|
||||||
|
/* Search the use/rename list for the variable; if the variable is
|
||||||
|
found, mark it. */
|
||||||
|
for (u = gfc_rename_list; u; u = u->next)
|
||||||
|
{
|
||||||
|
if (strcmp (u->use_name, sym->name) == 0)
|
||||||
|
{
|
||||||
|
sym->attr.use_only = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (p->u.rsym.renamed)
|
if (p->u.rsym.renamed)
|
||||||
sym->attr.use_rename = 1;
|
sym->attr.use_rename = 1;
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,12 @@
|
||||||
|
2012-04-06 Thomas Koenig <tkoenig@gcc.gnu.org>
|
||||||
|
|
||||||
|
PR fortran/52668
|
||||||
|
* gfortran.dg/use_only_6.f90: New test.
|
||||||
|
|
||||||
|
2012-04-06 Thomas Koenig <tkoenig@gcc.gnu.org>
|
||||||
|
|
||||||
|
PR fortran/52668
|
||||||
|
* gfortran.dg/use_only_6.f90: New test.
|
||||||
2012-04-06 Mike Stump <mikestump@comcast.net>
|
2012-04-06 Mike Stump <mikestump@comcast.net>
|
||||||
|
|
||||||
PR testsuite/50722
|
PR testsuite/50722
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
! { dg-do compile }
|
||||||
|
! PR 52668 - there used to be a bogus warning about not using b.
|
||||||
|
! Original test case by Arnaud Desitter.
|
||||||
|
module mm
|
||||||
|
integer :: a, b
|
||||||
|
common /mm1/ a, b
|
||||||
|
end module mm
|
||||||
|
|
||||||
|
subroutine aa()
|
||||||
|
use mm, only: a
|
||||||
|
implicit none
|
||||||
|
a = 1
|
||||||
|
end subroutine aa
|
Loading…
Reference in New Issue