re PR fortran/58470 ([OOP] ICE on invalid with FINAL procedure and type extension)

2014-02-08  Janus Weil  <janus@gcc.gnu.org>
	    Mikael Morin <mikael.morin@gcc.gnu.org>

	PR fortran/58470
	* class.c (generate_finalization_wrapper): Assert that proc_tree has
	been set in gfc_resolve_finalizers.
	* resolve.c (resolve_fl_derived0): Remove unnecessary call to
	gfc_is_finalizable.


2014-02-08  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/58470
	* gfortran.dg/finalize_22.f90: New.

Co-Authored-By: Mikael Morin <mikael@gcc.gnu.org>

From-SVN: r207636
This commit is contained in:
Janus Weil 2014-02-08 22:32:25 +01:00
parent df3927406e
commit a6cd299b54
5 changed files with 35 additions and 6 deletions

View File

@ -1,3 +1,12 @@
2014-02-08 Janus Weil <janus@gcc.gnu.org>
Mikael Morin <mikael.morin@gcc.gnu.org>
PR fortran/58470
* class.c (generate_finalization_wrapper): Assert that proc_tree has
been set in gfc_resolve_finalizers.
* resolve.c (resolve_fl_derived0): Remove unnecessary call to
gfc_is_finalizable.
2014-02-07 Benno Schulenberg <bensberg@justemail.net>
PR translation/52289

View File

@ -1880,8 +1880,7 @@ generate_finalization_wrapper (gfc_symbol *derived, gfc_namespace *ns,
for (fini = derived->f2k_derived->finalizers; fini; fini = fini->next)
{
if (!fini->proc_tree)
fini->proc_tree = gfc_find_sym_in_symtree (fini->proc_sym);
gcc_assert (fini->proc_tree); /* Should have been set in gfc_resolve_finalizers. */
if (fini->proc_tree->n.sym->attr.elemental)
{
fini_elem = fini;

View File

@ -12455,10 +12455,6 @@ resolve_fl_derived0 (gfc_symbol *sym)
/* Add derived type to the derived type list. */
add_dt_to_dt_list (sym);
/* Check if the type is finalizable. This is done in order to ensure that the
finalization wrapper is generated early enough. */
gfc_is_finalizable (sym, NULL);
return true;
}

View File

@ -1,3 +1,8 @@
2014-02-08 Janus Weil <janus@gcc.gnu.org>
PR fortran/58470
* gfortran.dg/finalize_22.f90: New.
2014-02-08 Paul Thomas <pault@gcc.gnu.org>
PR fortran/60066

View File

@ -0,0 +1,20 @@
! { dg-do compile }
!
! PR 58470: [4.9 Regression] [OOP] ICE on invalid with FINAL procedure and type extension
!
! Contributed by Andrew Benson <abensonca@gmail.com>
module cf
type :: cfml
contains
final :: mld
end type cfml
type, extends(cfml) :: cfmde
end type cfmde
contains
subroutine mld(s) ! { dg-error "must be of type" }
class(cfml), intent(inout) :: s
end subroutine mld
end module cf
! { dg-final { cleanup-modules "cf" } }