[Bug fortran/61767] [OOP] ICE in generate_finalization_wrapper at fortran/class.c:1491
janus at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Nov 25 17:52:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61767
janus at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |janus at gcc dot gnu.org
--- Comment #7 from janus at gcc dot gnu.org ---
This alternative patch fixes the ICE as well:
Index: gcc/fortran/class.c
===================================================================
--- gcc/fortran/class.c (revision 242880)
+++ gcc/fortran/class.c (working copy)
@@ -2445,7 +2445,8 @@ gfc_find_derived_vtab (gfc_symbol *derived)
c->attr.access = ACCESS_PRIVATE;
c->tb = XCNEW (gfc_typebound_proc);
c->tb->ppc = 1;
- generate_finalization_wrapper (derived, ns, tname, c);
+ if (gfc_is_finalizable (derived, NULL))
+ generate_finalization_wrapper (derived, ns, tname, c);
/* Add component _deallocate. */
if (!gfc_add_component (vtype, "_deallocate", &c))
@@ -2574,10 +2575,10 @@ gfc_is_finalizable (gfc_symbol *derived, gfc_expr
return false;
yes:
- /* Make sure vtab is generated. */
- vtab = gfc_find_derived_vtab (derived);
if (final_expr)
{
+ /* Make sure vtab is generated. */
+ vtab = gfc_find_derived_vtab (derived);
/* Return finalizer expression. */
gfc_component *final;
final = vtab->ts.u.derived->components->next->next->next->next->next;
It avoids calling generate_finalization_wrapper for non-finalizable types at
all, and thus might even be preferable over the previous patch (provided it
regtests fine, which I don't know yet).
More information about the Gcc-bugs
mailing list