public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: "Martin Liška" <mliska@suse.cz>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] lto-dump: Do not print output file
Date: Fri, 8 Jul 2022 12:49:39 +0200	[thread overview]
Message-ID: <CAFiYyc3a-ydsV-iB7NGE9q_+dhh6qogDtLQGx=iZQR_HE8eVpA@mail.gmail.com> (raw)
In-Reply-To: <aa9967a5-ad55-7feb-7e9a-3612ce59a34a@suse.cz>

On Thu, Jul 7, 2022 at 3:05 PM Martin Liška <mliska@suse.cz> wrote:
>
> Right now the following is printed:
>
> lto-dump
>         .file   "<artificial>"
>         .ident  "GCC: (GNU) 13.0.0 20220707 (experimental)"
>         .section        .note.GNU-stack,"",@progbits
>
> After the patch we print -help and do not emit any assembly output:
>
> lto-dump
> Usage: lto-dump [OPTION]... SUB_COMMAND [OPTION]...
>
> LTO dump tool command line options.
>
>   -list [options]           Dump the symbol list.
>     -demangle               Dump the demangled output.
>     -defined-only           Dump only the defined symbols.
> ...
>
> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
>
> Ready to be installed?

OK

> Thanks,
> Martin
>
> gcc/lto/ChangeLog:
>
>         * lto-dump.cc (lto_main): Exit in the function
>         as we don't want any LTO bytecode processing.
>
> gcc/ChangeLog:
>
>         * toplev.cc (init_asm_output): Do not init asm_out_file.
> ---
>  gcc/lto/lto-dump.cc | 16 ++++++++++------
>  gcc/toplev.cc       |  2 +-
>  2 files changed, 11 insertions(+), 7 deletions(-)
>
> diff --git a/gcc/lto/lto-dump.cc b/gcc/lto/lto-dump.cc
> index f88486b5143..f3d852df51f 100644
> --- a/gcc/lto/lto-dump.cc
> +++ b/gcc/lto/lto-dump.cc
> @@ -316,7 +316,10 @@ lto_main (void)
>  {
>    quiet_flag = true;
>    if (flag_lto_dump_tool_help)
> -    dump_tool_help ();
> +    {
> +      dump_tool_help ();
> +      exit (SUCCESS_EXIT_CODE);
> +    }
>
>    /* LTO is called as a front end, even though it is not a front end.
>       Because it is called as a front end, TV_PHASE_PARSING and
> @@ -369,11 +372,12 @@ lto_main (void)
>      {
>        /* Dump specific gimple body of specified function.  */
>        dump_body ();
> -      return;
>      }
>    else if (flag_dump_callgraph)
> -    {
> -      dump_symtab_graphviz ();
> -      return;
> -    }
> +    dump_symtab_graphviz ();
> +  else
> +    dump_tool_help ();
> +
> +  /* Exit right now.  */
> +  exit (SUCCESS_EXIT_CODE);
>  }
> diff --git a/gcc/toplev.cc b/gcc/toplev.cc
> index a24ad5db438..61d234a9ef4 100644
> --- a/gcc/toplev.cc
> +++ b/gcc/toplev.cc
> @@ -721,7 +721,7 @@ init_asm_output (const char *name)
>                      "cannot open %qs for writing: %m", asm_file_name);
>      }
>
> -  if (!flag_syntax_only)
> +  if (!flag_syntax_only && !(global_dc->lang_mask & CL_LTODump))
>      {
>        targetm.asm_out.file_start ();
>
> --
> 2.36.1
>

      reply	other threads:[~2022-07-08 10:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-07 13:05 Martin Liška
2022-07-08 10:49 ` Richard Biener [this message]

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='CAFiYyc3a-ydsV-iB7NGE9q_+dhh6qogDtLQGx=iZQR_HE8eVpA@mail.gmail.com' \
    --to=richard.guenther@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=mliska@suse.cz \
    /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).