https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84487
--- Comment #24 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to Thomas Koenig from comment #22) > This patch > > Index: trans-decl.c > =================================================================== > --- trans-decl.c (Revision 269895) > +++ trans-decl.c (Arbeitskopie) > @@ -1863,10 +1863,6 @@ gfc_get_symbol_decl (gfc_symbol * sym) > if (sym->attr.associate_var) > GFC_DECL_ASSOCIATE_VAR_P (decl) = 1; > > - if (sym->attr.vtab > - || (sym->name[0] == '_' && gfc_str_startswith (sym->name, > "__def_init"))) > - TREE_READONLY (decl) = 1; > - > return decl; > } > > leads to > > FAIL: gfortran.dg/gomp/pr52531.f90 -O (test for excess errors) > Excess errors: > /home/ig25/Gcc/trunk/gcc/testsuite/gfortran.dg/gomp/pr52531.f90:10:0: Error: > '__vtab_test_mod_Test_type' not specified in enclosing 'parallel' > /home/ig25/Gcc/trunk/gcc/testsuite/gfortran.dg/gomp/pr52531.f90:9:0: Error: > enclosing 'parallel' > > where I have no idea if this is just a cosmetic bug which > can, for example, be shut up with a check for attr.artificial, > or if this points towards a real problem. > > Jakub, could you maybe shed any light? For the artificially generated variables, the middle-end needs the FE to make those artificial vars predetermined shared (or whatever other predetermination), as it is something that isn't really visible in user code and thus there is no way for the user to specify it explicitly in data sharing clauses.