Re: [patch, Fortran, doc] Update descriptions for UNSIGNED

2024-10-26 Thread Iain Sandoe



> On 26 Oct 2024, at 22:41, Thomas Koenig  wrote:
> 
> Am 26.10.24 um 22:10 schrieb Iain Sandoe:
>>> Pushed (4727bfb37701f3fef98a5f8b60dcd2daa82e8143).
>> This seems to have broken —enable-languages=all bootstrap with
>>  /src-local/gcc-master/gcc/fortran/intrinsic.texi:39: node `Intrinsic 
>> Procedures' lacks menu item for `UINT' despite being its Up target
>> /src-local/gcc-master/gcc/fortran/intrinsic.texi:14934: warning: node prev 
>> `UMASK' in menu `UCOBOUND' and in sectioning `UINT’ differ
> 
> That is weird - if this is not picked up with "make info", "make html"
> and "make pdf", what command is needed to trigger it?  Or is it
> --enable-languages=all vs. --enable-languages=c,c++,fortran which I use?

make info was enough to trigger it in my testing.

It might depend on the version of makeinfo [6.7 on both the platforms I saw 
fail].

Iain

> 
>> I think the following patch (which will no doubt be whitespace-mangled my 
>> mailer) is needed - under test
> 
> If you're already testing it, please commit if it passes (approved if
> any approval is needed).

OK - thanks - will post the final patch here.
Iain

> 
> Thanks for the help!
> 
> Best regards
> 
>   Thomas
> 
> 
>> diff --git a/gcc/fortran/intrinsic.texi b/gcc/fortran/intrinsic.texi
>> index 0354704e4d0..f47fa3bbd5e 100644
>> --- a/gcc/fortran/intrinsic.texi
>> +++ b/gcc/fortran/intrinsic.texi
>> @@ -321,6 +321,7 @@ Some basic guidelines for editing this document:
>>  * @code{TTYNAM}:TTYNAM,Get the name of a terminal device
>>  * @code{UBOUND}:UBOUND,Upper dimension bounds of an array
>>  * @code{UCOBOUND}:  UCOBOUND,  Upper codimension bounds of an array
>> +* @code{UINT}:  UINT,  Convert to an unsigned integer type
>>  * @code{UMASK}: UMASK, Set the file creation mask
>>  * @code{UNLINK}:UNLINK,Remove a file from the file system
>>  * @code{UNPACK}:UNPACK,Unpack an array of rank one into an array
> 
> 
> 



Re: [patch, Fortran, doc] Update descriptions for UNSIGNED

2024-10-26 Thread Thomas Koenig

Am 26.10.24 um 22:10 schrieb Iain Sandoe:

Pushed (4727bfb37701f3fef98a5f8b60dcd2daa82e8143).

This seems to have broken —enable-languages=all bootstrap with

  /src-local/gcc-master/gcc/fortran/intrinsic.texi:39: node `Intrinsic 
Procedures' lacks menu item for `UINT' despite being its Up target
/src-local/gcc-master/gcc/fortran/intrinsic.texi:14934: warning: node prev 
`UMASK' in menu `UCOBOUND' and in sectioning `UINT’ differ


That is weird - if this is not picked up with "make info", "make html"
and "make pdf", what command is needed to trigger it?  Or is it
--enable-languages=all vs. --enable-languages=c,c++,fortran which I use?


I think the following patch (which will no doubt be whitespace-mangled my 
mailer) is needed - under test


If you're already testing it, please commit if it passes (approved if
any approval is needed).

Thanks for the help!

Best regards

Thomas




diff --git a/gcc/fortran/intrinsic.texi b/gcc/fortran/intrinsic.texi
index 0354704e4d0..f47fa3bbd5e 100644
--- a/gcc/fortran/intrinsic.texi
+++ b/gcc/fortran/intrinsic.texi
@@ -321,6 +321,7 @@ Some basic guidelines for editing this document:
  * @code{TTYNAM}:TTYNAM,Get the name of a terminal device
  * @code{UBOUND}:UBOUND,Upper dimension bounds of an array
  * @code{UCOBOUND}:  UCOBOUND,  Upper codimension bounds of an array
+* @code{UINT}:  UINT,  Convert to an unsigned integer type
  * @code{UMASK}: UMASK, Set the file creation mask
  * @code{UNLINK}:UNLINK,Remove a file from the file system
  * @code{UNPACK}:UNPACK,Unpack an array of rank one into an array






[pushed] doc, fortran: Add a missing menu item.

2024-10-26 Thread Iain Sandoe
Tested on x86_64-darwin21 and linux, with makeinfo 6.7 pushed to trunk,
thanks
Iain

--- 8< ---

The changes in r15-4697-g4727bfb37701 omit a menu entry which causes a
bootstrap fail when Fortran is included for at least makeinfo 6.7.
Fixed thus.

gcc/fortran/ChangeLog:

* intrinsic.texi: Add menu item for UINT.

Signed-off-by: Iain Sandoe 
---
 gcc/fortran/intrinsic.texi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gcc/fortran/intrinsic.texi b/gcc/fortran/intrinsic.texi
index 0354704e4d0..f47fa3bbd5e 100644
--- a/gcc/fortran/intrinsic.texi
+++ b/gcc/fortran/intrinsic.texi
@@ -321,6 +321,7 @@ Some basic guidelines for editing this document:
 * @code{TTYNAM}:TTYNAM,Get the name of a terminal device
 * @code{UBOUND}:UBOUND,Upper dimension bounds of an array
 * @code{UCOBOUND}:  UCOBOUND,  Upper codimension bounds of an array
+* @code{UINT}:  UINT,  Convert to an unsigned integer type
 * @code{UMASK}: UMASK, Set the file creation mask
 * @code{UNLINK}:UNLINK,Remove a file from the file system
 * @code{UNPACK}:UNPACK,Unpack an array of rank one into an array
-- 
2.39.2 (Apple Git-143)



[patch, Fortran, doc] Update descriptions for UNSIGNED

2024-10-26 Thread Thomas Koenig

Hello world,

the attached patch adds documentation for the long list of intrinsics
which take UNSIGNED arguments. Checked with "make html", "make pdf" and
"make info".

gcc/fortran/ChangeLog:

* gfortran.texi: Correct reference to make clear that UNSIGNED
will not be part of F202Y.
Other clarifications.
Extend table of intrinsics, add links.
* intrinsic.texi: Add descriptions for UNSIGNED arguments.
* invoke.texi: Add anchor for -funsigned.

OK for trunk?

Best regards

Thomasdiff --git a/gcc/fortran/gfortran.texi b/gcc/fortran/gfortran.texi
index 76326e625f8..a20053ed611 100644
--- a/gcc/fortran/gfortran.texi
+++ b/gcc/fortran/gfortran.texi
@@ -1192,7 +1192,7 @@ extensions.
 @menu
 * Extensions implemented in GNU Fortran::
 * Extensions not implemented in GNU Fortran::
-* Experimental features for Fortran 202Y::
+* Experimental features for future Fortran versions::
 @end menu
 
 
@@ -2702,19 +2702,19 @@ descriptor occurred, use @code{INQUIRE} to get the file position,
 count the characters up to the next @code{NEW_LINE} and then start
 reading from the position marked previously.
 
-@node Experimental features for Fortran 202Y
-@section Experimental features for Fortran 202Y
-@cindex Fortran 202Y
+@node Experimental features for future Fortran versions
+@section Experimental features future Fortran versions
+@cindex Future Fortran versions
 
 GNU Fortran supports some experimental features which have been
 proposed and accepted by the J3 standards committee.  These
 exist to give users a chance to try them out, and to provide
 a reference implementation.
 
-As these features have not been finalized, there is a chance that the
-version in the upcoming standard will differ from what GNU Fortran
-currently implements.  Stability of these implementations is therefore
-not guaranteed.
+As these features have not been included in the worklist for Fortran
+202Y by WG5, there is a chance that a version in any upcoming standard
+will differ from what GNU Fortran currently implements.  These
+features are therefore currently classified as an extension.
 
 @menu
 * Unsigned integers::
@@ -2723,11 +2723,12 @@ not guaranteed.
 @node Unsigned integers
 @subsection Unsigned integers
 @cindex Unsigned integers
-GNU Fortran supports unsigned integers according to
+If the @option{-funsigned} option is given, GNU Fortran supports
+unsigned integers according to
 @uref{https://j3-fortran.org/doc/year/24/24-116.txt, J3/24-116}.  The
-data type is called @code{UNSIGNED}.  For an unsigned type with $n$ bits,
-it implements integer arithmetic modulo @code{2**n}, comparable to the
-@code{unsigned} data type in C.
+data type is called @code{UNSIGNED}.  For an unsigned type with @code{n}
+bits, it implements integer arithmetic modulo @code{2**n}, comparable
+to the @code{unsigned} data type in C.
 
 The data type has @code{KIND} numbers comparable to other Fortran data
 types, which can be selected via the @code{SELECTED_UNSIGNED_KIND}
@@ -2771,31 +2772,75 @@ formatted and unformatted I/O.  For formatted I/O, the @code{B},
 values and values which would overflow are rejected with
 @code{-pedantic}.
 
-As of now, the following intrinsics take unsigned arguments:
+The following intrinsics take unsigned arguments:
 @itemize @bullet
-@item @code{BLT}, @code{BLE}, @code{BGE} and @code{BGT}. These intrinsics
-  are actually redundant because comparison operators could be used
-  directly.
-@item @code{IAND}, @code{IOR}, @code{IEOR} and @code{NOT}
-@item @code{BIT_SIZE}, @code{DIGITS} and @code{HUGE}
-@item @code{DSHIFTL} and @code{DSHIFTR}
-@item @code{IBCLR}, @code{IBITS} and @code{IBSET}
-@item @code{MIN} and @code{MAX}
-@item @code{ISHFT}, @code{ISHFTC}, @code{SHIFTL}, @code{SHIFTR} and
-  @code{SHIFTA}.
-@item @code{MERGE_BITS}
-@item @code{MOD} and @code{MODULO}
-@item @code{MVBITS}
-@item @code{RANGE}
-@item @code{TRANSFER}
-@item @code{SUM}, @code{PRODUCT}, @code{MATMUL} and @code{DOT_PRODUCT}
-@item @code{IANY}, @code{IALL} and @code{IPARITY}
-@item @code{RANDOM_NUMBER}
-@item @code{CSHIFT} and @code{EOSHIFT}
-@item @code{FINDLOC}
-@item @code{MAXVAL} and @code{MINVAL}
-@item @code{MAXLOC} and @code{MINLOC}.
+@item @code{BGE}, @pxref{BGE}
+@item @code{BGT}, @pxref{BGT}
+@item @code{BIT_SIZE}, @pxref{BIT_SIZE}
+@item @code{BLE}, @pxref{BLE}
+@item @code{BLT}, @pxref{BLT}
+@item @code{CSHIFT}, @pxref{CSHIFT}
+@item @code{DIGITS}, @pxref{DIGITS}
+@item @code{DOT_PRODUCT}, @pxref{DOT_PRODUCT}
+@item @code{DSHIFTL}, @pxref{DSHIFTL}
+@item @code{DSHIFTR}, @pxref{DSHIFTR}
+@item @code{EOSHIFT}, @pxref{EOSHIFT}
+@item @code{FINDLOC}, @pxref{FINDLOC}
+@item @code{HUGE}, @pxref{HUGE}
+@item @code{IALL}, @pxref{IALL}
+@item @code{IAND}, @pxref{IAND}
+@item @code{IANY}, @pxref{IANY}
+@item @code{IBCLR}, @pxref{IBCLR}
+@item @code{IBITS}, @pxref{IBITS}
+@item @code{IBSET}, @pxref{IBSET}
+@item @code{IEOR}, @pxref{IEOR}
+@item @code{IOR}, @pxref{IOR}
+@item @code{IPARITY}, 

Re: [patch, Fortran, doc] Update descriptions for UNSIGNED

2024-10-26 Thread Steve Kargl
On Sat, Oct 26, 2024 at 05:16:54PM +0200, Thomas Koenig wrote:
> 
> OK for trunk?
> 

OK, but see below.

> +@item @code{SUM}, @pxref{SUM}
> +@item @code{TRANSPOSE}, @pxref{TRANSPOSE}
> +@item @code{TRANSFER}, @pxref{TRANSFER}
>  @end itemize
> +
> +The following intrincis are enabled with @option{-funsigned}:

s/intrincis/intrinsics


> +@item @var{I} @tab Shall be of @code{INTEGER} or @code{UNSIGNED} type.
> +@item @var{J} @tab Shall be of of the same type and kind as @var{I}.
>  @end multitable

"of of" need to delete one.
 

> +@item @var{I} @tab Shall be of @code{INTEGER} or @code{UNSIGNED} type.
> +@item @var{J} @tab Shall be of of the same type and kind as @var{I}.

"of of" 

> +@item @var{I} @tab Shall be of @code{INTEGER} or @code{UNSIGNED} type.
> +@item @var{J} @tab Shall be of of the same type and kind as @var{I}.

"of of"

-- 
Steve


Re: [patch, Fortran, doc] Update descriptions for UNSIGNED

2024-10-26 Thread Iain Sandoe
Hi Thomas

> On 26 Oct 2024, at 18:28, Thomas Koenig  wrote:
> 
> Hi Steve,
> 
>>> OK for trunk?
>>> 
>> OK, but see below.
> 
> Pushed (4727bfb37701f3fef98a5f8b60dcd2daa82e8143). 

This seems to have broken —enable-languages=all bootstrap with

 /src-local/gcc-master/gcc/fortran/intrinsic.texi:39: node `Intrinsic 
Procedures' lacks menu item for `UINT' despite being its Up target
/src-local/gcc-master/gcc/fortran/intrinsic.texi:14934: warning: node prev 
`UMASK' in menu `UCOBOUND' and in sectioning `UINT’ differ

I think the following patch (which will no doubt be whitespace-mangled my 
mailer) is needed - under test
thanks
Iain

diff --git a/gcc/fortran/intrinsic.texi b/gcc/fortran/intrinsic.texi
index 0354704e4d0..f47fa3bbd5e 100644
--- a/gcc/fortran/intrinsic.texi
+++ b/gcc/fortran/intrinsic.texi
@@ -321,6 +321,7 @@ Some basic guidelines for editing this document:
 * @code{TTYNAM}:TTYNAM,Get the name of a terminal device
 * @code{UBOUND}:UBOUND,Upper dimension bounds of an array
 * @code{UCOBOUND}:  UCOBOUND,  Upper codimension bounds of an array
+* @code{UINT}:  UINT,  Convert to an unsigned integer type
 * @code{UMASK}: UMASK, Set the file creation mask
 * @code{UNLINK}:UNLINK,Remove a file from the file system
 * @code{UNPACK}:UNPACK,Unpack an array of rank one into an array




Re: [patch, Fortran, doc] Update descriptions for UNSIGNED

2024-10-26 Thread Thomas Koenig

Hi Steve,


OK for trunk?



OK, but see below.


Pushed (4727bfb37701f3fef98a5f8b60dcd2daa82e8143). Thanks for
the proof-reading!

Best regards

Thomas