Hello Sandra and Harald, Many thanks for taking a look at the patch for PR99250. I admit that I was in something of a rush to get it out of the door so that I could return to the last few PDT problems.
The use of the KIND argument now works correctly and the testcase has been completely revamped to reflect this. The testcase runs correctly using the shared memory gfortran, for which Jerry has just posted a series of patches. Note that GFORTRAN_NUM_IMAGES=multiple_of_3 is required. When converted to .html, intrinsic.texi looks OK and is now ordered correctly. Regtests OK on FC43/x86_64 mainline. OK to push to mainline? Regards Paul On Mon, 9 Feb 2026 at 23:35, Sandra Loosemore <[email protected]> wrote: > > On 2/9/26 09:54, Paul Richard Thomas wrote: > > Hi All, > > > > This is a boilerplate implementation of the COSHAPE intrinsic. The > > testcase is placed in the main gfortran.dg directory so that it can > > make us of the option -fcoarry=lib to test the number of references to > > _gfortran_caf_num_images (One to set no_images and to for the upper > > bound of the last codimension). > > > > Regtests on FC43/x86_64. OK for mainline? > > > > Paul > > > > PS Could somebody please check the intrinsic.texi entries? > > Ack.... > > > diff --git a/gcc/fortran/intrinsic.texi b/gcc/fortran/intrinsic.texi > > index cf81791b8b3..accd7825e38 100644 > > --- a/gcc/fortran/intrinsic.texi > > +++ b/gcc/fortran/intrinsic.texi > > @@ -127,6 +127,7 @@ Some basic guidelines for editing this document: > > * @code{COS}: COS, Cosine function > > * @code{COSD}: COSD, Cosine function, degrees > > * @code{COSH}: COSH, Hyperbolic cosine function > > +* @code{COSHAPE}: COSHAPE, Determine the coshape of a array > > * @code{COSPI}: COSPI, Circular cosine function > > * @code{COTAN}: COTAN, Cotangent function > > * @code{COTAND}: COTAND, Cotangent function, degrees > > @@ -4635,6 +4636,34 @@ Inverse function: @* > > > > > > > > +@node COSHAPE > > +@section @code{COSHAPE} --- Coshape of a coarray > > +@fnindex COSHAPE > > +@cindex coarray, coshape > > + > > +@table @asis > > +@item @emph{Synopsis}: > > +@code{RESULT = COSHAPE(COARRAY [, KIND])} > > + > > +@item @emph{Description}: > > +Returns the shape of the cobounds of a coarray. > > + > > +@item @emph{Standard}: > > +Fortran 2018 > > + > > The subheadings have been reordered in the Fortran intrinsics > documentation. "Standard" now comes after "See also", or at the very > end of the node if there's no "See also". > > > +@item @emph{Class}: > > +Inquiry function > > + > > +@item @emph{Arguments}: > > +@multitable @columnfractions .15 .70 > > +@item @var{COARRAY} @tab Shall be an coarray, of any type. > > s/an coarray/a coarray/ > > > +@item @var{KIND} @tab (Optional) A scalar @code{INTEGER} constant > > +expression indicating the kind parameter of the result. > > I think there should be > > @item @emph{Return value}: > ...blah blah... > > after this. You could probably adapt the language from the SHAPE intrinsic. > > And, probably also add > > @item @emph{See also}: > > pointing at SHAPE. > > > +@end multitable > > +@end table > > + > > + > > + > > @node COSPI > > @section @code{COSPI} --- Circular cosine function > > @fnindex COSPI > > -Sandra >
