From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by sourceware.org (Postfix) with ESMTPS id 18BB43858D1E for ; Mon, 30 Jan 2023 07:48:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 18BB43858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-x136.google.com with SMTP id y25so17679681lfa.9 for ; Sun, 29 Jan 2023 23:48:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=xanIfoVsoL9x0kneQY0wYUrmPecsbaylGdbfeQvPC/s=; b=YxfOld7Y6bWEoishwF+YP1Crcp8fPG+iuxRRj+CRgQ/wzn+HKywOyudNUiszrK79FP 1O0GQFZIxToYMJs0a0VYccd76DuXmTwXG6eQdhv2ZViS5quPDtbOtA0IHrbGoqGAAg79 A0ssrczp0faAIMG5Sw4d8U3PhJAA+Mqhf1kkmLabI3I9wCJeYhC/Nb0Z3JnmSmKDG+aI vFuhYUNbrYibAYysGSSF2DzX8cKn209CAENDGUXrYwlSxQ7KPmHngVdCCNEx0EsZnerg sDm8ml0AyvPOm+ibEw1kFDv2Jzg53KODO9Cz3Gjac6bmod8El4lv19jWG43P0rA0wMpx oWvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=xanIfoVsoL9x0kneQY0wYUrmPecsbaylGdbfeQvPC/s=; b=o4/D8+p6+vfKH9f3HKcEyDx0w+V0cjm0xbTtytdru6P8dsFjx8a1cEKvUCJ0iMlS+E SiMkiaPaEm554qwQtQBB+7advV3UgrhDJWJeDqI9FRQz2Z/1VHXDlV6DeGTgdGWR0aEj pSIKigPAP9QqIeVE5BITxodfJd+nHg/2KP6xUaxp5SqOcLzuhsafUQvwOB7qVlzBgV/U HRQ4nHN9GU7m5KWgZnx8M7i5o/+hUKYi9Sv3Yf77Cq6h8i9BigOcS7xD3Tz0+1zabCdr nzkvw8YmXjyJSVzpUDyA6z1TSKaa2XOewDv1PUaLLSphO4LScrkFd2hf1sP2lohBcgAl j6RA== X-Gm-Message-State: AO0yUKVJhgAFYsG/Ayv1nw5SdaOmiVsjPD8v5VW8e37OPw6TR1pHTeB0 VDwvi92FrtYI+zr5+hFWjzAV7++lOoSQ7cusP3eSarWJ5Eg= X-Google-Smtp-Source: AK7set+44lmEap+4iEFNhCfUGulHTp7d4hTydMxcC/3st5GqoL1qD1JNOVV1qcCwhekYckFVII5PSfbDysShJfF9nWM= X-Received: by 2002:a19:8c4e:0:b0:4d8:5308:f795 with SMTP id i14-20020a198c4e000000b004d85308f795mr1044032lfj.10.1675064919403; Sun, 29 Jan 2023 23:48:39 -0800 (PST) MIME-Version: 1.0 References: <20230129113451.24516-1-iain@sandoe.co.uk> In-Reply-To: <20230129113451.24516-1-iain@sandoe.co.uk> From: Richard Biener Date: Mon, 30 Jan 2023 08:48:27 +0100 Message-ID: Subject: Re: [PATCH] driver, toplevel: Avoid emitting the version information twice. To: iain@sandoe.co.uk Cc: gcc-patches@gcc.gnu.org, Iain Sandoe , joseph@codesourcery.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.1 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 autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Sun, Jan 29, 2023 at 12:35 PM Iain Sandoe via Gcc-patches wrote: > > Technically, this is seems to be a regression somewhere between 4.2 and > 4.6 but, it seems, not enough for anyone to care too much. Tested on > various Darwin versions and x86_64, powerpc64 linux, > OK for trunk {now,stage1}? This will elide the earlier printing, right? I see > ./cc1 -quiet t.c -version -v GNU C17 (GCC) version 13.0.1 20230130 (experimental) (x86_64-pc-linux-gnu) compiled by GNU C version 7.5.0, GMP version 6.1.2, MPFR version 4.0.2-p6, MPC version 1.1.0, isl version isl-0.18-GMP GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096 ignoring nonexistent directory "/usr/local/lib64/gcc/x86_64-pc-linux-gnu/13.0.1/include" ignoring nonexistent directory "/usr/local/lib64/gcc/x86_64-pc-linux-gnu/13.0.1/include-fixed" ignoring nonexistent directory "/usr/local/lib64/../x86_64-pc-linux-gnu/include" #include "..." search starts here: #include <...> search starts here: /usr/local/include /usr/include End of search list. GNU C17 (GCC) version 13.0.1 20230130 (experimental) (x86_64-pc-linux-gnu) compiled by GNU C version 7.5.0, GMP version 6.1.2, MPFR version 4.0.2-p6, MPC version 1.1.0, isl version isl-0.18-GMP GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096 Compiler executable checksum: 04b9febc760f5d967341e708a5944221 eliding the 2nd would be prefered so the info comes first? > thanks, Iain > > --- 8< --- > > For a regular compile job, with -v we emit the GCC version information > twice - once from main() and once from process_options(). We do not need > to emit the former unless the compiler will exit before calling > process_options(), which is controlled by the 'exit_after_options' flag. > > Gating the first output on that flag resolves this. > > Signed-off-by: Iain Sandoe > > gcc/ChangeLog: > > * toplev.cc (toplev::main): Only print the version information from > the toplevel main() if we will exit before processing options. > --- > gcc/toplev.cc | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/gcc/toplev.cc b/gcc/toplev.cc > index 42937f0ba00..8beaa2ab64d 100644 > --- a/gcc/toplev.cc > +++ b/gcc/toplev.cc > @@ -2252,7 +2252,7 @@ toplev::main (int argc, char **argv) > > initialize_plugins (); > > - if (version_flag) > + if (version_flag && exit_after_options) > print_version (stderr, "", true); > > if (help_flag) > -- > 2.37.1 (Apple Git-137.1) >