public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "mikael at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/114922] fsyntax-only need the modules
Date: Fri, 03 May 2024 13:38:08 +0000	[thread overview]
Message-ID: <bug-114922-4-0RxatXGaU5@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-114922-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114922

Mikael Morin <mikael at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mikael at gcc dot gnu.org

--- Comment #4 from Mikael Morin <mikael at gcc dot gnu.org> ---
(In reply to Axel Ehrich from comment #3)

> In my understanding, the intention of the option -fsyntax-only is to
> construct the module files needed to compile the code. A  build process
> would involve two steps: Step 1: construct all module files with gfortran
> -fsyntax only. Step 2: construct the object files without this option, while
> relying on the presence of all module files. (I have found this recipe on
> the internet and consider it valuable.)
> 
The normal process is to compile directly the files (without -fsyntax-only) in
the right order, in a single step.  Some people prefer to do it in two steps,
depending on their needs.

> Alternatively, the purpose of -fsyntax-only could be to save compile time by
> a doing quick first check before entering the time consuming parts of the
> compilation. 
Yes, that's the main purpose.

> If this syntax check goes so far that it requires the module
> files already, the goal mentioned above cannot be reached.

Yes, it can.  The files have to be compiled in the right order.

Keep in mind that the compiler processes one file at a time and doesn't have
a global knowledge of all the files together.

Consider this example:
  module m2
    use m1
  end module m2

What symbols should be made available in the module file for m2?
Don't you think that the knowledge of the content of m1 is needed?

  parent reply	other threads:[~2024-05-03 13:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-02 12:47 [Bug fortran/114922] New: " axel.ehrich@tu-clausthal.de
2024-05-02 16:43 ` [Bug fortran/114922] " anlauf at gcc dot gnu.org
2024-05-02 17:38 ` kargls at comcast dot net
2024-05-03 10:50 ` axel.ehrich@tu-clausthal.de
2024-05-03 13:38 ` mikael at gcc dot gnu.org [this message]
2024-05-06  5:58 ` axel.ehrich@tu-clausthal.de

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=bug-114922-4-0RxatXGaU5@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.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).