https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98301
--- Comment #4 from kargl at gcc dot gnu.org --- Created attachment 49816 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49816&action=edit Newest patch. This new patch implements Thomas idea of generating appropriate library calls for the different ways that gfortran handles coarrays. * gcc/fortran/trans-decl.c: . Add definitions for gfor_fndecl_caf_random_init and gfor_fndecl_cas_random_init. * gcc/fortran/trans-intrinsic.c: . For -fcoarray=lib, generate a call to _gfortran_caf_random_init(). . For -fcoarray=shared, generate a call to _gfortran_cas_random_init(). . For -fcoarray=single or without the -fcoarray option, generate a call to _gfortran_random_init(). * gcc/fortran/trans.h: . Add declares for gfor_fndecl_caf_random_init and gfor_fndecl_cas_random_init * libgfortran/intrinsics/random_init.f90: . Rework _gfortran_random_init(), but preserve the ABI.