This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/50960] [OOP] vtables not marked as constant


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50960

--- Comment #1 from janus at gcc dot gnu.org 2011-11-02 11:57:44 UTC ---
(In reply to comment #0)
> < richi> and it seems the vtables are not initialized in a way the
>          optimizers could use them
> < richi> they are not constant

Right. I had thought of making them PARAMETERS earlier (to use Fortran
terminology). But in the early implementation this was not possible, since the
PPC members of the vtabs were not initialized statically. Now they are, so this
should work (in principle). I'll try if the following patch survives
regtesting:

Index: gcc/fortran/class.c
===================================================================
--- gcc/fortran/class.c (revision 180713)
+++ gcc/fortran/class.c (working copy)
@@ -424,7 +424,7 @@ gfc_find_derived_vtab (gfc_symbol *derived)
        {
          gfc_get_symbol (name, ns, &vtab);
          vtab->ts.type = BT_DERIVED;
-         if (gfc_add_flavor (&vtab->attr, FL_VARIABLE, NULL,
+         if (gfc_add_flavor (&vtab->attr, FL_PARAMETER, NULL,
                              &gfc_current_locus) == FAILURE)
            goto cleanup;
          vtab->attr.target = 1;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]