[prev in list] [next in list] [prev in thread] [next in thread]
List: gcc-fortran
Subject: Re: [Patch, Fortran, OOP, Regression] PR 60234: ICE in generate_finalization_wrapper at fortran/clas
From: Janus Weil <janus () gcc ! gnu ! org>
Date: 2014-02-21 9:15:50
Message-ID: CAKwh3qh5xzikA7x_S06rKEMJZNCNHgKuaMZoWKhEmx38CbocwQ () mail ! gmail ! com
[Download RAW message or body]
2014-02-21 8:25 GMT+01:00 Tobias Burnus <burnus@net-b.de>:
> 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.
this became necessary after the vtab changes (although I don't
remember which test case triggered it). comp_is_finalizable is called
(more or less directly) from generate_finalization_wrapper. Since the
latter was called too early, the problem with PPCs was not triggered
previously, it seems.
I have committed the patch as r207986. Thanks for the review!
Cheers,
Janus
>> 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.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic