Re: [Patch, fortran] PR99250 - [F2018] coshape intrinsic is missing

Sandra Loosemore <[email protected]>
Newsgroups gmane.comp.gcc.patches,gmane.comp.gcc.fortran
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.