diff options
author | Janus Weil <janus@gcc.gnu.org> | 2011-02-09 23:59:02 +0100 |
---|---|---|
committer | Janus Weil <janus@gcc.gnu.org> | 2011-02-09 23:59:02 +0100 |
commit | c79bb35514fb9ed2a63277bad7e71f0dd41664d7 (patch) | |
tree | 4dbcd292234b1adc3e966a8f6d085fca8d3f5686 | |
parent | 2181e7141cf1f517868e4aa657ad04f95f37c258 (diff) | |
download | gcc-c79bb35514fb9ed2a63277bad7e71f0dd41664d7.zip gcc-c79bb35514fb9ed2a63277bad7e71f0dd41664d7.tar.gz gcc-c79bb35514fb9ed2a63277bad7e71f0dd41664d7.tar.bz2 |
re PR fortran/47352 ([F03] ICE with proc-pointers in generic procedures)
2011-02-09 Janus Weil <janus@gcc.gnu.org>
PR fortran/47352
* resolve.c (resolve_procedure_interface): If interface has a result
variable, copy the typespec and set result pointer to self.
2011-02-09 Janus Weil <janus@gcc.gnu.org>
PR fortran/47352
* gfortran.dg/proc_decl_25.f90: New.
From-SVN: r169987
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/resolve.c | 5 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/proc_decl_25.f90 | 22 |
4 files changed, 37 insertions, 1 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 6475d5e..80cc4da 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,5 +1,11 @@ 2011-02-09 Janus Weil <janus@gcc.gnu.org> + PR fortran/47352 + * resolve.c (resolve_procedure_interface): If interface has a result + variable, copy the typespec and set result pointer to self. + +2011-02-09 Janus Weil <janus@gcc.gnu.org> + PR fortran/47463 * resolve.c (resolve_typebound_subroutine): Remove erroneous line. diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 688967a..0fe0672 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -160,7 +160,10 @@ resolve_procedure_interface (gfc_symbol *sym) resolve_intrinsic (ifc, &ifc->declared_at); if (ifc->result) - sym->ts = ifc->result->ts; + { + sym->ts = ifc->result->ts; + sym->result = sym; + } else sym->ts = ifc->ts; sym->ts.interface = ifc; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9725a49..e68a483 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2011-02-09 Janus Weil <janus@gcc.gnu.org> + PR fortran/47352 + * gfortran.dg/proc_decl_25.f90: New. + +2011-02-09 Janus Weil <janus@gcc.gnu.org> + PR fortran/47463 * gfortran.dg/typebound_assignment_2.f03: New. diff --git a/gcc/testsuite/gfortran.dg/proc_decl_25.f90 b/gcc/testsuite/gfortran.dg/proc_decl_25.f90 new file mode 100644 index 0000000..b455911 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/proc_decl_25.f90 @@ -0,0 +1,22 @@ +! { dg-do compile } +! +! PR 47352: [F03] ICE with proc-pointers in generic procedures +! +! Contributed by James van Buskirk +! cf. http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/bbaf59ffd7c372e9 + + implicit none + + abstract interface + real function f() + end function f + end interface + + procedure(f) :: f1 + + interface gen + procedure f1 + end interface gen + + write(*,*) gen() +end |