------- Comment #6 from janus at gcc dot gnu dot org  2010-07-30 18:46 -------
(In reply to comment #4)
> One observation: In case one does not have PRIVATE, one initializes seemingly
> the global variable
>    __polynomial_MOD_vtab
> while with PRIVATE and failing, one uses the variables vtab$polynomD which is
> local in "test_poly";

Good point. Actually the test case is fixed by making the vtab public:

Index: gcc/fortran/class.c
===================================================================
--- gcc/fortran/class.c (revision 162723)
+++ gcc/fortran/class.c (working copy)
@@ -343,6 +344,7 @@
          vtab->attr.target = 1;
          vtab->attr.save = SAVE_EXPLICIT;
          vtab->attr.vtab = 1;
+         vtab->attr.access = ACCESS_PUBLIC;
          vtab->refs++;
          gfc_set_sym_referenced (vtab);
          sprintf (name, "vtype$%s", derived->name);
@@ -357,6 +359,7 @@
              if (gfc_add_flavor (&vtype->attr, FL_DERIVED,
                                  NULL, &gfc_current_locus) == FAILURE)
                goto cleanup;
+             vtype->attr.access = ACCESS_PUBLIC;
              vtype->refs++;
              gfc_set_sym_referenced (vtype);


-- 


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

Reply via email to