re PR fortran/51056 ([OOP] Bogus "Unused module variable '__vtab_domain_Domain_container'")
2012-01-20 Tobias Burnus <burnus@net-b.de> Janus Weil <janus@gcc.gnu.org> PR fortran/51056 * module.c (load_needed, read_module): Don't mark __vtab etc. as use_only. 2012-01-20 Tobias Burnus <burnus@net-b.de> Janus Weil <janus@gcc.gnu.org> PR fortran/51056 * gfortran.dg/use_21.f90: New. Co-Authored-By: Janus Weil <janus@gcc.gnu.org> From-SVN: r183326
This commit is contained in:
parent
229bfbcff3
commit
583713e326
|
@ -1,3 +1,10 @@
|
||||||
|
2012-01-20 Tobias Burnus <burnus@net-b.de>
|
||||||
|
Janus Weil <janus@gcc.gnu.org>
|
||||||
|
|
||||||
|
PR fortran/51056
|
||||||
|
* module.c (load_needed, read_module): Don't mark __vtab etc.
|
||||||
|
as use_only.
|
||||||
|
|
||||||
2012-01-19 Tobias Burnus <burnus@net-b.de>
|
2012-01-19 Tobias Burnus <burnus@net-b.de>
|
||||||
|
|
||||||
PR fortran/51904
|
PR fortran/51904
|
||||||
|
|
|
@ -4351,7 +4351,11 @@ load_needed (pointer_info *p)
|
||||||
|
|
||||||
mio_symbol (sym);
|
mio_symbol (sym);
|
||||||
sym->attr.use_assoc = 1;
|
sym->attr.use_assoc = 1;
|
||||||
if (only_flag)
|
|
||||||
|
/* Mark as only or rename for later diagnosis for explicitly imported
|
||||||
|
but not used warnings; don't mark internal symbols such as __vtab,
|
||||||
|
__def_init etc. */
|
||||||
|
if (only_flag && sym->name[0] != '_' && sym->name[1] != '_')
|
||||||
sym->attr.use_only = 1;
|
sym->attr.use_only = 1;
|
||||||
if (p->u.rsym.renamed)
|
if (p->u.rsym.renamed)
|
||||||
sym->attr.use_rename = 1;
|
sym->attr.use_rename = 1;
|
||||||
|
@ -4574,8 +4578,9 @@ read_module (void)
|
||||||
p = name;
|
p = name;
|
||||||
|
|
||||||
/* Exception: Always import vtabs & vtypes. */
|
/* Exception: Always import vtabs & vtypes. */
|
||||||
if (p == NULL && (strncmp (name, "__vtab_", 5) == 0
|
if (p == NULL && name[0] == '_'
|
||||||
|| strncmp (name, "__vtype_", 6) == 0))
|
&& (strncmp (name, "__vtab_", 5) == 0
|
||||||
|
|| strncmp (name, "__vtype_", 6) == 0))
|
||||||
p = name;
|
p = name;
|
||||||
|
|
||||||
/* Skip symtree nodes not in an ONLY clause, unless there
|
/* Skip symtree nodes not in an ONLY clause, unless there
|
||||||
|
@ -4641,7 +4646,10 @@ read_module (void)
|
||||||
if (strcmp (name, p) != 0)
|
if (strcmp (name, p) != 0)
|
||||||
sym->attr.use_rename = 1;
|
sym->attr.use_rename = 1;
|
||||||
|
|
||||||
sym->attr.use_only = only_flag;
|
if (name[0] != '_'
|
||||||
|
|| (strncmp (name, "__vtab_", 5) != 0
|
||||||
|
&& strncmp (name, "__vtype_", 6) != 0))
|
||||||
|
sym->attr.use_only = only_flag;
|
||||||
|
|
||||||
/* Store the symtree pointing to this symbol. */
|
/* Store the symtree pointing to this symbol. */
|
||||||
info->u.rsym.symtree = st;
|
info->u.rsym.symtree = st;
|
||||||
|
|
|
@ -1,3 +1,9 @@
|
||||||
|
2012-01-20 Tobias Burnus <burnus@net-b.de>
|
||||||
|
Janus Weil <janus@gcc.gnu.org>
|
||||||
|
|
||||||
|
PR fortran/51056
|
||||||
|
* gfortran.dg/use_21.f90: New.
|
||||||
|
|
||||||
2012-01-20 Jakub Jelinek <jakub@redhat.com>
|
2012-01-20 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
PR target/51106
|
PR target/51106
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
! { dg-do compile }
|
||||||
|
! { dg-options "-Wall" }
|
||||||
|
!
|
||||||
|
! PR fortran/51056
|
||||||
|
!
|
||||||
|
! Contributed by Kacper Kowalik
|
||||||
|
!
|
||||||
|
module domain
|
||||||
|
implicit none
|
||||||
|
private
|
||||||
|
public :: domain_container, dom
|
||||||
|
|
||||||
|
type :: domain_container
|
||||||
|
integer :: D_x !< set to 1 when x-direction exists, 0 otherwise
|
||||||
|
contains
|
||||||
|
procedure :: init => init_domain_container
|
||||||
|
end type domain_container
|
||||||
|
|
||||||
|
type(domain_container) :: dom
|
||||||
|
|
||||||
|
contains
|
||||||
|
subroutine init_domain_container(this)
|
||||||
|
implicit none
|
||||||
|
class(domain_container), intent(inout) :: this
|
||||||
|
this%D_x = 0
|
||||||
|
end subroutine init_domain_container
|
||||||
|
end module domain
|
||||||
|
|
||||||
|
program ala
|
||||||
|
use domain, only: dom
|
||||||
|
implicit none
|
||||||
|
call dom%init
|
||||||
|
end program ala
|
||||||
|
|
||||||
|
! { dg-final { cleanup-modules "domain" } }
|
Loading…
Reference in New Issue