https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125354
--- Comment #6 from Steve Kargl <kargl at gcc dot gnu.org> --- (In reply to Paul Thomas from comment #5) > (In reply to Steve Kargl from comment #4) > > (In reply to Paul Thomas from comment #0) > > > It crosses my mind that, since coarrays are part of the fortran language > > > specification, we should aim to make -fcoarray=shared the default. > > > > > > PR125113 should IMHO be fixed before implementing this step. > > > > Do all targets have a pthread library? If yes, and GCC can use > > it, then sure -fcoarray=shared may make sense. OTOH, what if > > there is not shmem library? > > > > In addition, at least with FreeBSD, one needs to add -lpthread > > to to command line (or use the -pthread option) if one uses > > -fcoarray=shared. The pthread functions do not live in libc. > > > > I submitted a patch to the mailing list a long time ago to > > make -fcoarray=single the default. I no longer have the > > patch, and neither duck-duck-go nor google search had turned > > up the patch. > > As usual, you make an excellent and convincing point! > Looking at last week's mailing list, Rainer Orth was dealing with Solaris and shmem coarrays in the testsuite. Older versions of Solaris apparently don't have a pthread library while newer versions do. I fully support making -fcoarray=single the default. A Fortran compiler should compile conforming code without user intervention to add options to the command line. If gfortran detects a file using coarray, we should probably issue a warning/message telling the user to check the documentation about -fcoarray.
