From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1851) id 90DF2385021A; Fri, 8 Jul 2022 10:53:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 90DF2385021A MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Martin Liska To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-1574] lto-dump: Do not print output file X-Act-Checkin: gcc X-Git-Author: Martin Liska X-Git-Refname: refs/heads/master X-Git-Oldrev: f7854e2faf7640230062dec3596e71773ca500ed X-Git-Newrev: 95a234f5cbd510e6b8c8e53dd9f1003fddc84c28 Message-Id: <20220708105316.90DF2385021A@sourceware.org> Date: Fri, 8 Jul 2022 10:53:16 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jul 2022 10:53:16 -0000 https://gcc.gnu.org/g:95a234f5cbd510e6b8c8e53dd9f1003fddc84c28 commit r13-1574-g95a234f5cbd510e6b8c8e53dd9f1003fddc84c28 Author: Martin Liska Date: Mon Jul 4 16:32:51 2022 +0200 lto-dump: Do not print output file Right now the following is printed: lto-dump .file "" .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. ... 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. Diff: --- 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 ();