Re: Fortran: Use non conflicting file extensions for intermediates [PR81615]

2023-12-27 Thread Harald Anlauf

Hi Rimvydas!

Am 24.12.23 um 02:33 schrieb Rimvydas Jasinskas:

Documentation part.
The makeinfo gcc/fortran/gfortran.texi does not seem to have any new warnings.


The patch is almost fine, except for a strange wording here:

+@smallexample
+gfortran -save-temps -c foo.F90
+@end smallexample
+
+preprocesses to in @file{foo.fii}, compiles to an intermediate
+@file{foo.s}, and then assembles to the (implied) output file
+@file{foo.o}, whereas:

I understand the formulation is copied from gcc/doc/invoke.texi,
where it does not fully make sense to me either.

How about:

"preprocesses input file @file{foo.F90} to @file{foo.fii}, ..."

Furthermore,

+@smallexample
+gfortran -save-temps -S foo.F
+@end smallexample
+
+saves the (no longer) temporary preprocessed file in @file{foo.fi}, and
+then compiles to the (implied) output file @file{foo.s}.

Even if this is copied from the gcc texinfo file, how about:

"saves the preprocessor output in @file{foo.fi}, ..."

which I find easier to read.

Can you also add a reference to the PR number in the commit message?


Is there a specific reason thy -fc-prototypes (Interoperability
Options section) is excluded from manpage?


Can you be more specific?  I get here (since gcc-9):

% man /opt/gcc/14/share/man/man1/gfortran.1 |grep -A 1 "Interoperability
Options"
   Interoperability Options
   -fc-prototypes -fc-prototypes-external

although no detailed explanation (-> gfortran.info).


Regards,
Rimvydas


Thanks,
Harald



Re: Fortran: Use non conflicting file extensions for intermediates [PR81615]

2023-12-27 Thread Rimvydas Jasinskas
On Wed, Dec 27, 2023 at 10:34 PM Harald Anlauf  wrote:
> The patch is almost fine, except for a strange wording here:
>
> +@smallexample
> +gfortran -save-temps -c foo.F90
> +@end smallexample
> +
> +preprocesses to in @file{foo.fii}, compiles to an intermediate
> +@file{foo.s}, and then assembles to the (implied) output file
> +@file{foo.o}, whereas:
>
> I understand the formulation is copied from gcc/doc/invoke.texi,
> where it does not fully make sense to me either.
>
> How about:
>
> "preprocesses input file @file{foo.F90} to @file{foo.fii}, ..."
>
> Furthermore,
>
> +@smallexample
> +gfortran -save-temps -S foo.F
> +@end smallexample
> +
> +saves the (no longer) temporary preprocessed file in @file{foo.fi}, and
> +then compiles to the (implied) output file @file{foo.s}.
>
> Even if this is copied from the gcc texinfo file, how about:
>
> "saves the preprocessor output in @file{foo.fi}, ..."
>
> which I find easier to read.
>
> Can you also add a reference to the PR number in the commit message?
I agree, wording sounds a lot better, included in v2 together with PR number.


> > Is there a specific reason thy -fc-prototypes (Interoperability
> > Options section) is excluded from manpage?
>
> Can you be more specific?  I get here (since gcc-9):
>
> % man /opt/gcc/14/share/man/man1/gfortran.1 |grep -A 1 "Interoperability
> Options"
> Interoperability Options
> -fc-prototypes -fc-prototypes-external
>
> although no detailed explanation (-> gfortran.info).
The https://gcc.gnu.org/onlinedocs/gfortran/Invoking-GNU-Fortran.html
does contain a working link to
https://gcc.gnu.org/onlinedocs/gfortran/Interoperability-Options.html
However the manpage has Interoperability section explicitly disabled
with "@c man end" ... "@c man begin ENVIRONMENT".
After digging into git log it seems that Interoperability section was
unintentionally added after this comment mark in
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=e655a6cc43

Best regards,
Rimvydas
From f8663a022a8b9c4f1c4a76d8e4823e24f691623c Mon Sep 17 00:00:00 2001
From: Rimvydas Jasinskas 
Date: Sat, 23 Dec 2023 18:59:09 +
Subject: Fortran: Add Developer Options mini-section to documentation

Separate out -fdump-* options to the new section.  Sort by option name.

While there, document -save-temps intermediates.

gcc/fortran/ChangeLog:

	PR fortran/81615
	* invoke.texi: Add Developer Options section.  Move '-fdump-*'
	to it.  Add small examples about changed '-save-temps' behavior.

Signed-off-by: Rimvydas Jasinskas 
---
 gcc/fortran/invoke.texi | 117 ++--
 1 file changed, 77 insertions(+), 40 deletions(-)

diff --git a/gcc/fortran/invoke.texi b/gcc/fortran/invoke.texi
index c7fd019a7c5..5d526e23e5c 100644
--- a/gcc/fortran/invoke.texi
+++ b/gcc/fortran/invoke.texi
@@ -94,12 +94,13 @@ one is not the default.
  compiled.
 * Preprocessing Options::  Enable and customize preprocessing.
 * Error and Warning Options:: How picky should the compiler be?
-* Debugging Options::   Symbol tables, measurements, and debugging dumps.
+* Debugging Options::   Symbol tables, measurements.
 * Directory Options::   Where to find module files
 * Link Options ::   Influencing the linking step
 * Runtime Options:: Influencing runtime behavior
 * Code Gen Options::Specifying conventions for function calls, data layout
 and register usage.
+* Developer Options::   Printing GNU Fortran specific info, debugging dumps.
 * Interoperability Options::  Options for interoperability with other
   languages.
 * Environment Variables:: Environment variables that affect @command{gfortran}.
@@ -159,9 +160,8 @@ and warnings}.
 }
 
 @item Debugging Options
-@xref{Debugging Options,,Options for debugging your program or GNU Fortran}.
-@gccoptlist{-fbacktrace -fdump-fortran-optimized -fdump-fortran-original
--fdebug-aux-vars -fdump-fortran-global -fdump-parse-tree -ffpe-trap=@var{list}
+@xref{Debugging Options,,Options for debugging your program}.
+@gccoptlist{-fbacktrace -fdebug-aux-vars -ffpe-trap=@var{list}
 -ffpe-summary=@var{list}
 }
 
@@ -201,6 +201,12 @@ and warnings}.
 -fpack-derived -frealloc-lhs -frecursive -frepack-arrays
 -fshort-enums -fstack-arrays
 }
+
+@item Developer Options
+@xref{Developer Options,,GNU Fortran Developer Options}.
+@gccoptlist{-fdump-fortran-global -fdump-fortran-optimized
+-fdump-fortran-original -fdump-parse-tree -save-temps
+}
 @end table
 
 @node Fortran Dialect Options
@@ -1280,40 +1286,14 @@ and other GNU compilers.
 Some of these have no effect when compiling programs written in Fortran.
 
 @node Debugging Options
-@section Options for debugging your program or GNU Fortran
+@section Options for debugging your program
 @cindex options, debugging
 @cindex debugging information options
 
 GNU Fortran has various special options that are used for debugging
-either your program or the GNU Fortran compiler.
+yo