This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/60234] [4.9 Regression] [OOP] ICE in generate_finalization_wrapper at fortran/class.c:1883
- From: "janus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 17 Feb 2014 13:46:25 +0000
- Subject: [Bug fortran/60234] [4.9 Regression] [OOP] ICE in generate_finalization_wrapper at fortran/class.c:1883
- Auto-submitted: auto-generated
- References: <bug-60234-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60234
--- Comment #6 from janus at gcc dot gnu.org ---
(In reply to janus from comment #5)
> Unfortunately the combination fails on proc_ptr_comp_37 in the testsuite.
To fix this, another hunk in class.c is needed, so that the patch becomes:
Index: gcc/fortran/class.c
===================================================================
--- gcc/fortran/class.c (revision 207823)
+++ gcc/fortran/class.c (working copy)
@@ -637,9 +637,10 @@ gfc_build_class_symbol (gfc_typespec *ts, symbol_a
if (!gfc_add_component (fclass, "_vptr", &c))
return false;
c->ts.type = BT_DERIVED;
- if (delayed_vtab
- || (ts->u.derived->f2k_derived
- && ts->u.derived->f2k_derived->finalizers))
+ if ((delayed_vtab
+ || (ts->u.derived->f2k_derived
+ && ts->u.derived->f2k_derived->finalizers))
+ && !ts->u.derived->attr.unlimited_polymorphic)
c->ts.u.derived = NULL;
else
{
@@ -790,7 +791,9 @@ has_finalizer_component (gfc_symbol *derived)
static bool
comp_is_finalizable (gfc_component *comp)
{
- if (comp->attr.allocatable && comp->ts.type != BT_CLASS)
+ if (comp->attr.proc_pointer)
+ return false;
+ else if (comp->attr.allocatable && comp->ts.type != BT_CLASS)
return true;
else if (comp->ts.type == BT_DERIVED && !comp->attr.pointer
&& (comp->ts.u.derived->attr.alloc_comp
Index: gcc/fortran/decl.c
===================================================================
--- gcc/fortran/decl.c (revision 207823)
+++ gcc/fortran/decl.c (working copy)
@@ -1199,7 +1199,7 @@ build_sym (const char *name, gfc_charlen *cl, bool
sym->attr.implied_index = 0;
if (sym->ts.type == BT_CLASS)
- return gfc_build_class_symbol (&sym->ts, &sym->attr, &sym->as, false);
+ return gfc_build_class_symbol (&sym->ts, &sym->attr, &sym->as, true);
return true;
}
This should be free of testsuite failures.