public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Rimvydas Jasinskas <rimvydasjas@gmail.com>
To: Harald Anlauf <anlauf@gmx.de>
Cc: Rimvydas Jasinskas via Fortran <fortran@gcc.gnu.org>,
	gcc-patches@gnu.org
Subject: Re: Fortran: Use non conflicting file extensions for intermediates [PR81615]
Date: Thu, 28 Dec 2023 09:09:54 +0200	[thread overview]
Message-ID: <CAFmAMQ28JZYXf7bpw1rHN=GUgtdWD9VYe+QQOJpa=_eB+r1s1g@mail.gmail.com> (raw)
In-Reply-To: <295e0172-68b9-4b05-bded-95c418b690fa@gmx.de>

[-- Attachment #1: Type: text/plain, Size: 2070 bytes --]

On Wed, Dec 27, 2023 at 10:34 PM Harald Anlauf <anlauf@gmx.de> 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

[-- Attachment #2: 0002-Fortran-Add-Developer-Options-mini-section-to-docume.patch --]
[-- Type: text/x-patch, Size: 8056 bytes --]

From f8663a022a8b9c4f1c4a76d8e4823e24f691623c Mon Sep 17 00:00:00 2001
From: Rimvydas Jasinskas <rimvydas.jas@gmail.com>
Date: Sat, 23 Dec 2023 18:59:09 +0000
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 <rimvydas.jas@gmail.com>
---
 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.
+your program.
 
 @table @gcctabopt
-@opindex @code{fdump-fortran-original}
-@item -fdump-fortran-original
-Output the internal parse tree after translating the source program
-into internal representation.  This option is mostly useful for
-debugging the GNU Fortran compiler itself. The output generated by
-this option might change between releases. This option may also
-generate internal compiler errors for features which have only
-recently been added.
-
-@opindex @code{fdump-fortran-optimized}
-@item -fdump-fortran-optimized
-Output the parse tree after front-end optimization.  Mostly useful for
-debugging the GNU Fortran compiler itself. The output generated by
-this option might change between releases.  This option may also
-generate internal compiler errors for features which have only
-recently been added.
-
-@opindex @code{fdump-parse-tree}
-@item -fdump-parse-tree
-Output the internal parse tree after translating the source program
-into internal representation.  Mostly useful for debugging the GNU
-Fortran compiler itself. The output generated by this option might
-change between releases. This option may also generate internal
-compiler errors for features which have only recently been added. This
-option is deprecated; use @code{-fdump-fortran-original} instead.
-
 @opindex @code{fdebug-aux-vars}
 @item -fdebug-aux-vars
 Renames internal variables created by the gfortran front end and makes
@@ -1323,14 +1303,6 @@ useful for debugging the compiler's code generation together with
 @code{-fdump-tree-original} and enabling debugging of the executable
 program by using @code{-g} or @code{-ggdb3}.
 
-@opindex @code{fdump-fortran-global}
-@item -fdump-fortran-global
-Output a list of the global identifiers after translating into
-middle-end representation. Mostly useful for debugging the GNU Fortran
-compiler itself. The output generated by this option might change
-between releases.  This option may also generate internal compiler
-errors for features which have only recently been added.
-
 @opindex @code{ffpe-trap=}@var{list}
 @item -ffpe-trap=@var{list}
 Specify a list of floating point exception traps to enable.  On most
@@ -1543,6 +1515,71 @@ and regards zero as positive number in the @code{SIGN} intrinsic for
 compatibility with Fortran 77. The default is @option{-fsign-zero}.
 @end table
 
+@node Developer Options
+@section GNU Fortran Developer Options
+@cindex options, debugging
+@cindex developer options
+
+GNU Fortran has various special options that are used for debugging
+the GNU Fortran compiler.
+
+@table @gcctabopt
+@opindex @code{fdump-fortran-global}
+@item -fdump-fortran-global
+Output a list of the global identifiers after translating into
+middle-end representation. Mostly useful for debugging the GNU Fortran
+compiler itself. The output generated by this option might change
+between releases.  This option may also generate internal compiler
+errors for features which have only recently been added.
+
+@opindex @code{fdump-fortran-optimized}
+@item -fdump-fortran-optimized
+Output the parse tree after front-end optimization.  Mostly useful for
+debugging the GNU Fortran compiler itself. The output generated by
+this option might change between releases.  This option may also
+generate internal compiler errors for features which have only
+recently been added.
+
+@opindex @code{fdump-fortran-original}
+@item -fdump-fortran-original
+Output the internal parse tree after translating the source program
+into internal representation.  This option is mostly useful for
+debugging the GNU Fortran compiler itself. The output generated by
+this option might change between releases. This option may also
+generate internal compiler errors for features which have only
+recently been added.
+
+@opindex @code{fdump-parse-tree}
+@item -fdump-parse-tree
+Output the internal parse tree after translating the source program
+into internal representation.  Mostly useful for debugging the GNU
+Fortran compiler itself. The output generated by this option might
+change between releases. This option may also generate internal
+compiler errors for features which have only recently been added. This
+option is deprecated; use @code{-fdump-fortran-original} instead.
+
+@item -save-temps
+Store the usual ``temporary'' intermediate files permanently; name them
+as auxiliary output files, as specified described under GCC
+@option{-dumpbase} and @option{-dumpdir}.
+
+@smallexample
+gfortran -save-temps -c foo.F90
+@end smallexample
+
+preprocesses input file @file{foo.F90} to @file{foo.fii}, compiles to an
+intermediate @file{foo.s}, and then assembles to the (implied) output
+file @file{foo.o}, whereas:
+
+@smallexample
+gfortran -save-temps -S foo.F
+@end smallexample
+
+saves the preprocessor output in @file{foo.fi}, and then compiles to
+the (implied) output file @file{foo.s}.
+
+@end table
+
 @node Code Gen Options
 @section Options for code generation conventions
 @cindex code generation, conventions
-- 
2.43.0


  parent reply	other threads:[~2023-12-28  7:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-20  4:32 Rimvydas Jasinskas
2023-12-20 19:29 ` Harald Anlauf
2023-12-20 19:29   ` Harald Anlauf
2023-12-24  1:33   ` Rimvydas Jasinskas
2023-12-27 20:34     ` Harald Anlauf
2023-12-27 20:34       ` Harald Anlauf
2023-12-28  7:09       ` Rimvydas Jasinskas [this message]
2023-12-28 20:31         ` Harald Anlauf
2023-12-28 20:31           ` Harald Anlauf
2023-12-30 11:01     ` Thomas Koenig
2023-12-30 11:08       ` Thomas Koenig
2024-01-01 21:25         ` Harald Anlauf
2024-01-01 21:25           ` Harald Anlauf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFmAMQ28JZYXf7bpw1rHN=GUgtdWD9VYe+QQOJpa=_eB+r1s1g@mail.gmail.com' \
    --to=rimvydasjas@gmail.com \
    --cc=anlauf@gmx.de \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).