From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-x82f.google.com (mail-qt1-x82f.google.com [IPv6:2607:f8b0:4864:20::82f]) by sourceware.org (Postfix) with ESMTPS id 3789B385843E for ; Fri, 8 Jul 2022 10:49:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3789B385843E Received: by mail-qt1-x82f.google.com with SMTP id ck6so26622773qtb.7 for ; Fri, 08 Jul 2022 03:49:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=waHKXZr7TlU1ondlIws0m8jYmAPcXo/e7es8LGQu2VY=; b=S0/EnGPG2Mx6cK7QRo1+9YFs1hpJFc3hMK2oyCWzxvrfqdWXVyftndHcqFnMbKHbpR mVYBnFB/ZGkOWqSOLmHP8C6FbPj4Sn1/TzrM2tchD925iGmGsPEh61/QIYnyA6F6D7fs ciDXQILRlPH0/Cv5HORU6ToEpT6RVLmj96mJSRtYcQIIu6/AXNxHNfAr+jF/2q4vlQqB Fm2QeRskMyiShn0Gg/TMr0qbAf/CQf1mQRQjt5UlQMNAXMD9tz2et/kUUSuossVr27VI /8zNlFShncPFcOxR7lbYR1VimYP9hamXZE7ND8U9dosVcFWeGb21rgFrOutQeNGjPCjx rUVg== X-Gm-Message-State: AJIora82aUQmmD3cZWzudev9V6F4/o59lztROMEpfn+chFwlSSaSzR2W 3/qJTPaDlMGPeTyDD5cWKRzzjXyhReM1wwT7Gbw= X-Google-Smtp-Source: AGRyM1vYFMOCm0mNjkftLUyjE8TOXrpQOr2zavJhZJMy1B2+s7Au6krDqQUlOAOOZfAK/HgJJmejVbqObsIR/W+YKro= X-Received: by 2002:a05:6214:2129:b0:470:396d:19c4 with SMTP id r9-20020a056214212900b00470396d19c4mr2081630qvc.34.1657277390542; Fri, 08 Jul 2022 03:49:50 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Richard Biener Date: Fri, 8 Jul 2022 12:49:39 +0200 Message-ID: Subject: Re: [PATCH] lto-dump: Do not print output file To: =?UTF-8?Q?Martin_Li=C5=A1ka?= Cc: GCC Patches Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, 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: Fri, 08 Jul 2022 10:49:52 -0000 On Thu, Jul 7, 2022 at 3:05 PM Martin Li=C5=A1ka wrote: > > 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? 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 =3D 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 >