This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [Patch, Fortran, OOP] PR 50960: vtables not marked as constant
- From: Paul Richard Thomas <paul dot richard dot thomas at gmail dot com>
- To: Janus Weil <janus at gcc dot gnu dot org>
- Cc: gfortran <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 8 Nov 2011 19:34:51 +0100
- Subject: Re: [Patch, Fortran, OOP] PR 50960: vtables not marked as constant
- References: <CAKwh3qh=FF-4zt7Gy26u3EJir0y2CHrtzX_MsuF3X5Oca2WhzA@mail.gmail.com>
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