re PR fortran/39688 (IMPORT of derived type fails)

2009-04-25  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/39688
	* decl.c (gfc_match_import): Use 'sym->name' instead of 'name'.
	They differ if the symbol has been use-renamed.


2009-04-25  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/39688
	* gfortran.dg/import7.f90: New.

From-SVN: r146762
This commit is contained in:
Janus Weil 2009-04-25 10:11:48 +02:00
parent a3a5e3d16c
commit bc2a4733e2
4 changed files with 70 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2009-04-25 Janus Weil <janus@gcc.gnu.org>
PR fortran/39688
* decl.c (gfc_match_import): Use 'sym->name' instead of 'name'.
They differ if the symbol has been use-renamed.
2009-04-24 Ian Lance Taylor <iant@google.com>
* gfortran.h (enum gfc_symbol_type): New named enum type, broken

View File

@ -2741,7 +2741,7 @@ gfc_match_import (void)
goto next_item;
}
st = gfc_new_symtree (&gfc_current_ns->sym_root, name);
st = gfc_new_symtree (&gfc_current_ns->sym_root, sym->name);
st->n.sym = sym;
sym->refs++;
sym->attr.imported = 1;

View File

@ -1,3 +1,8 @@
2009-04-25 Janus Weil <janus@gcc.gnu.org>
PR fortran/39688
* gfortran.dg/import7.f90: New.
2009-04-24 Richard Guenther <rguenther@suse.de>
* gcc.dg/tree-ssa/vrp48.c: Fix.

View File

@ -0,0 +1,58 @@
! { dg-do compile }
!
! PR39688: IMPORT of derived type fails
!
! Contributed by Bob Corbett <robert.corbett@sun.com>
MODULE MOD
TYPE T1
SEQUENCE
TYPE(T2), POINTER :: P
END TYPE
TYPE T2
SEQUENCE
INTEGER I
END TYPE
END
PROGRAM MAIN
USE MOD, T3 => T1, T4 => T2
TYPE T1
SEQUENCE
TYPE(T2), POINTER :: P
END TYPE
INTERFACE SUBR
SUBROUTINE SUBR1(X)
IMPORT T3
TYPE(T3) X
END SUBROUTINE
SUBROUTINE SUBR2(X)
IMPORT T1
TYPE(T1) X
END SUBROUTINE
END INTERFACE
TYPE T2
SEQUENCE
REAL X
END TYPE
END
SUBROUTINE SUBR1(X)
USE MOD
TYPE(T1) X
END
SUBROUTINE SUBR2(X)
TYPE T1
SEQUENCE
TYPE(T2), POINTER :: P
END TYPE
TYPE T2
SEQUENCE
REAL X
END TYPE
TYPE(T1) X
END
! { dg-final { cleanup-modules "mod" } }