[Patch, Fortran, OOP] PR 50960: vtables not marked as constant
Paul Richard Thomas
paul.richard.thomas@gmail.com
Tue Nov 8 18:56:00 GMT 2011
Hi Janus,
As part of Tobias's fix for PR50640, he introduced:
+ if ((sym->attr.flavor == FL_PARAMETER
+ && (sym->attr.dimension || sym->ts.type == BT_DERIVED))
+ || sym->attr.vtab)
TREE_READONLY (decl) = 1;
Is this not sufficient to fix this PR too?
Otherwise, your patch is, of course, OK.
Paul
On Tue, Nov 8, 2011 at 11:51 AM, Janus Weil <janus@gcc.gnu.org> wrote:
> Hi all,
>
> the attached patch marks the 'vtab' symbols as constant
> (FL_PARAMETER). They are fixed objects which are initialized once and
> never change.
>
> Regtested on x86_64-unknown-linux-gnu. Ok for trunk?
>
> Is it ok to commit without a test case? If not, any suggestions how a
> good test case could look like?
>
> Cheers,
> Janus
>
>
> 2011-11-08 Janus Weil <janus@gcc.gnu.org>
>
> PR fortran/50960
> * class.c (gfc_find_derived_vtab): Make the vtab symbols FL_PARAMETER.
> * expr.c (gfc_simplify_expr): Prevent vtabs from being replaced with
> their value.
> * resolve.c (resolve_values): Use-associated symbols do not need to
> be resolved again.
> (resolve_fl_parameter): Make sure the symbol has a value.
>
--
The knack of flying is learning how to throw yourself at the ground and miss.
--Hitchhikers Guide to the Galaxy
More information about the Gcc-patches
mailing list