From patchwork Sun Jan 29 11:34:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 49959 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1709098wrn; Sun, 29 Jan 2023 03:35:38 -0800 (PST) X-Google-Smtp-Source: AMrXdXvGXz0ZeyYWFER7//w5SMZKjITeeV9vbmDz48r8+vUjRFLU0lxHy13FHpcraVi+JITv6egQ X-Received: by 2002:a17:906:3bd8:b0:7c0:b3a3:9b70 with SMTP id v24-20020a1709063bd800b007c0b3a39b70mr49683521ejf.62.1674992138632; Sun, 29 Jan 2023 03:35:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674992138; cv=none; d=google.com; s=arc-20160816; b=TEcvAFPtktPa5dpSQnoNKbF6nMcP8zSww4xSoXqei+0DSXwnJ85isYLNRYpfj8YIqf 631GBTwueRL+/kdSZaFeCcwGCsxwlhiFqBk0PIpDXCF+o4RWDp1wNG766d1GbLnPSC+i E51Dd68k1fDvk2uptbDFCQYBnbk3xRTk69NnlAQ3ofBv0XgsH4cbG/H7JG5gFfwE6di/ p73av1cf0PBWfJ9zmpy+DMQOkaulWCbACgtyIbj1auRbDO7j2UzlGQVzjHaSWCYXjF43 1GAqhNfTgMjxi737/N2CHjw+1ROccGOi3rYFhqCrGuM5Rn9AEsbuokanu8ZqC6M7m5M1 YyjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:reply-to:from:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=JTlB4l4ZHHzxzIYJOJrJhPs1tKWEi2Eir3BdxSRHlGo=; b=DnXLGXoYka/Ut6WgPQW+DZKFwSJyBn/ApyzF8xT2Wr35NMhHcOVjAHCWdF07OfzNsN j/PGjDjBxLAjBrl4NWjNHCsrWB1jDPt7aINI7KgeBQy97LV/VyUEdqg8BlYulkdcC8Lh zusjGtD7rIa2TkD34iBz54t4AOOFJojYK0smTAMcVVjYZsx1hNJRqgW+htW+ki55y3vX 7y5oitU143S6D6ygFGDJZ+gqMA0yybS2MtaWm5yIHJLhj3opZ7YnqTw4J9fbMntiuRSv 5DwMo6kSd7/NSOiSH+2AR/ez7MaHh0Mmkfy1HC7oSPPCj2eK57H1kmAPBiBDVbMDO6Av nBOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=ucFlQfUL; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id hd16-20020a170907969000b0086ac03cc7d6si15739404ejc.180.2023.01.29.03.35.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Jan 2023 03:35:38 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=ucFlQfUL; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6F49F3858C3A for ; Sun, 29 Jan 2023 11:35:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6F49F3858C3A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1674992137; bh=JTlB4l4ZHHzxzIYJOJrJhPs1tKWEi2Eir3BdxSRHlGo=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=ucFlQfULnUTdS0q3NfZwi+8ab0+RADS+H9P3faRPRkq7pKpQ5gN65GHOqK3y353rf aIFRFyDQCsm6ebEpwF/eYcN1QauVfoZ61BWBxK27PNSUWQxt4OMogNqrqsAOuzEUzC 7lYchnWPkGOtZvnxJRtEA6lRNeO4UOfRYJDIEchk= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by sourceware.org (Postfix) with ESMTPS id 9E1F33858D32 for ; Sun, 29 Jan 2023 11:34:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9E1F33858D32 Received: by mail-wm1-x32c.google.com with SMTP id bg26so424744wmb.0 for ; Sun, 29 Jan 2023 03:34:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:reply-to:message-id:date :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=JTlB4l4ZHHzxzIYJOJrJhPs1tKWEi2Eir3BdxSRHlGo=; b=fa4DuO8PIYdZjMRqwez8kxEGhLhO06e1wH2sC3rlozsS1xrTDL44DQjN6VkB2dmj79 tEuKZkd4nvEa7xVlkFoCA5qumsRH9AMyoXYQMd+UNHaZ22UYI8d5pMnsIUf1VZ2lIntd vdlaR7eooXQzO04Ay2Kpd3ZtOVWgToiO7uwe+n0zEHBAHljfz0cVt1j26zW8QSiwSpPU pD5mw1NQjtekDUaYKQdKFON6Ho82uNCC/xKLuLVrbd2S/a1So/J7v5kGuQfWyXezULxD sMymYp06fHZ2951t1uNeEvvhphQW8RYEG/htwBI1qFHYn+yTguyeEfURIEkqxL5mM8tM W15g== X-Gm-Message-State: AFqh2konM174SNwNMeNC9Y5jDBBJD8Yrif2EKioG9RDTPO6N+hE7rdHW h0VwSroLIdmogywa4fPqiNnwBV4rNe4= X-Received: by 2002:a05:600c:3d16:b0:3cf:8b22:76b3 with SMTP id bh22-20020a05600c3d1600b003cf8b2276b3mr43848225wmb.0.1674992092349; Sun, 29 Jan 2023 03:34:52 -0800 (PST) Received: from localhost.localdomain (host81-138-1-83.in-addr.btopenworld.com. [81.138.1.83]) by smtp.gmail.com with ESMTPSA id n5-20020a5d6b85000000b002be2279f100sm778752wrx.96.2023.01.29.03.34.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 29 Jan 2023 03:34:51 -0800 (PST) X-Google-Original-From: Iain Sandoe To: gcc-patches@gcc.gnu.org Subject: [PATCH] driver, toplevel: Avoid emitting the version information twice. Date: Sun, 29 Jan 2023 11:34:51 +0000 Message-Id: <20230129113451.24516-1-iain@sandoe.co.uk> X-Mailer: git-send-email 2.37.1 (Apple Git-137.1) MIME-Version: 1.0 X-Spam-Status: No, score=-8.3 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 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-Patchwork-Original-From: Iain Sandoe via Gcc-patches From: Iain Sandoe Reply-To: iain@sandoe.co.uk Cc: Iain Sandoe , joseph@codesourcery.com Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756356556797106916?= X-GMAIL-MSGID: =?utf-8?q?1756356556797106916?= 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}? 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. Signed-off-by: Iain Sandoe --- 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)