https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78152
--- Comment #5 from Steve Kargl <sgk at troutmask dot apl.washington.edu> --- On Tue, Nov 01, 2016 at 08:32:46PM +0000, pault at gcc dot gnu.org wrote: > > > > Someone needs to submit an interpretation request to J3. > > > If you bypass the error for associate names, does such code run correctly? The code compiles with the rather trivial patch (watch for cut-n-paste whitespace corruption). Index: gcc/fortran/resolve.c =================================================================== --- gcc/fortran/resolve.c (revision 241667) +++ gcc/fortran/resolve.c (working copy) @@ -14630,7 +14630,9 @@ resolve_symbol (gfc_symbol *sym) || (sym->ns->save_all && !sym->attr.automatic) || sym->ns->proc_name->attr.flavor == FL_MODULE || sym->ns->proc_name->attr.is_main_program - || sym->attr.function || sym->attr.result || sym->attr.use_assoc)) + || sym->attr.function || sym->attr.result + || sym->attr.use_assoc + || sym->attr.associate_var)) { gfc_error ("Variable %qs at %L is a coarray and is not ALLOCATABLE, SAVE " "nor a dummy argument", sym->name, &sym->declared_at); The original testcase and my altered code are rather trivial and don't do anything within the ASSOCIATE constructed. I suspect that it will be get optimized out. > Also, what do the other brands do? Fortunately, I use FreeBSD as my operating system, which unfortunately limits me to gfortran. I posted to c.l.f, but haven't got much feedback.