[Bug fortran/60234] [4.9 Regression] [OOP] ICE in generate_finalization_wrapper at fortran/class.c:1883
janus at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Feb 17 13:46:00 GMT 2014
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.
More information about the Gcc-bugs
mailing list