[Patch, Fortran, OOP, Regression] PR 60234: ICE in generate_finalization_wrapper at fortran/class.c:1883

Tobias Burnus burnus@net-b.de
Fri Feb 21 07:26:00 GMT 2014


Hi Janus,

Janus Weil wrote:
> What the patch does is to defer the building of the vtabs to a later
> stage. Previously this was done only for some rare cases, now we do it
> basically for all vtabs. This is necessary with finalization, since
> building the vtab also implies building the finalization wrapper, for
> which it is necessary that the finalizers have been resolved.
>
> Anyway, the patch regtests cleanly on x86_64-unknown-linux-gnu. Ok for trunk?

Looks good to me.

Does

  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)

fix an other PR - or did you just spot it when looking at the code? It 
it certainly simple, correct and should go in.

Tobias

> 2014-02-20  Janus Weil  <janus@gcc.gnu.org>
>
>      PR fortran/60234
>      * gfortran.h (gfc_build_class_symbol): Removed argument.
>      * class.c (gfc_add_component_ref): Fix up missing vtype if necessary.
>      (gfc_build_class_symbol): Remove argument 'delayed_vtab'. vtab is always
>      delayed now, except for unlimited polymorphics.
>      (comp_is_finalizable): Procedure pointer components are not finalizable.
>      * decl. (build_sym, build_struct, attr_decl1): Removed argument of
>      'gfc_build_class_symbol'.
>      * match.c (copy_ts_from_selector_to_associate, select_type_set_tmp):
>      Ditto.
>      * symbol.c (gfc_set_default_type): Ditto.
>
>
> 2014-02-20  Janus Weil  <janus@gcc.gnu.org>
>
>      PR fortran/60234
>      * gfortran.dg/finalize_23.f90: New.



More information about the Fortran mailing list