From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id DA1FB3858D32 for ; Thu, 7 Jul 2022 13:05:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DA1FB3858D32 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 9406D220C4 for ; Thu, 7 Jul 2022 13:05:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1657199117; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lt59D1CdQUb2SBfxhA3xHSEff5j4MJAOD+rndl5+jaw=; b=d5HrH2dCVcsv5ECJyInY2VhvZoRwSXgv8Oatq5cVpK94p7Kc03D824Pzu/8fKNfC3Jw6+Z rN7Zydvp9PVz5X8NzxP+ONdtK8SEgn0ENaSK6cbEhXKbmJ5fifLUF/Q1OJ5Z41o8Vz3tuQ +XulYqfzPBio9lJVlf+FzIxXxMfitvQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1657199117; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lt59D1CdQUb2SBfxhA3xHSEff5j4MJAOD+rndl5+jaw=; b=HuPxNkDg2nJNzGdAnhatFaYAA5lqbmGC5uAWcqXQlAmKv3O5/mNMVOZeERtF3emldK6RVE 6/PsNtre2MQ9NUCw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 84B8513461 for ; Thu, 7 Jul 2022 13:05:17 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id MK9hHw3axmImBgAAMHmgww (envelope-from ) for ; Thu, 07 Jul 2022 13:05:17 +0000 Message-ID: Date: Thu, 7 Jul 2022 15:05:17 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Subject: [PATCH] lto-dump: Do not print output file To: gcc-patches@gcc.gnu.org Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jul 2022 13:05:20 -0000 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. ... Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be installed? 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