Hi Steve, hi all, thank you for pointing that out, Steve. When I started the work, I told myself, that I have to remember to add your patch to the submit. Well, that did not last for more than eight hours and I had forgotten. So here is now the combination of Steve's and my patch (attached). Bootstrapped and regtested ok on x86_64/f33. @Steve: Is this your correct mail address for the changelog or do you prefer a different one? Regards, Andre Changelog: Steve Kargl PR fortran/98301 - random_init() is broken Correct implementation of random_init() when -fcoarray=lib is given. gcc/fortran/ChangeLog: PR fortran/98301 * trans-decl.c (gfc_build_builtin_function_decls): Move decl. * trans-intrinsic.c (conv_intrinsic_random_init): Use bool for lib-call of caf_random_init instead of logical (4-byte). * trans.h: Add tree var for random_init. libgfortran/ChangeLog: PR fortran/98301 * caf/libcaf.h (_gfortran_caf_random_init): New function. * caf/single.c (_gfortran_caf_random_init): New function. * gfortran.map: Added fndecl. * intrinsics/random_init.f90: Implement random_init. On Fri, 23 Apr 2021 10:18:17 -0700 Steve Kargl wrote: > Andre, > > Thanks for taking care of OpenCoarray portion of RANDOM_INIT. > My last non-coarray aware patch is attached to the PR in bugzilla. > Since the change over to git, I no longer commit to the source tree. > I suggest combining your patch with my patch if you intend to > commit; otherwise, attach your patch to the PR and sit patiently > until someone can do the combined commit. > -- Andre Vehreschild * Email: vehre ad gmx dot de