From patchwork Thu Mar 23 16:00:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 74105 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2995069wrt; Thu, 23 Mar 2023 09:01:17 -0700 (PDT) X-Google-Smtp-Source: AKy350ZkoqYKCB4KmpGRvZHznK3iZ7nfIA9JG4AfYNJ77QziwXYlox9Tg0x4nbqhTwMQJHaq9Bb1 X-Received: by 2002:a5d:4687:0:b0:2ce:a9e9:5da2 with SMTP id u7-20020a5d4687000000b002cea9e95da2mr3091240wrq.6.1679587277659; Thu, 23 Mar 2023 09:01:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679587277; cv=none; d=google.com; s=arc-20160816; b=cvmUskxu4p1Gk+5SaVfunP42DdJ4TivTrsbG+C5DQqEw31mINuqSQ2WqzpT62t9Hdu 3fe3MrbBwr2IhoWEuo7LtqyZjs2rT7pLBbr7M3v34zKXPA8xg7uWKNC3L+8G+8geKOhc 1VHTZveLi4lmrarA5J9mt5ulnQPRtSrkoBFbpuVW3kFStm3JzQV5w4E/s01z5R0DjyK5 x/ilQhqZkIV59pbKlAbDO7yYeY9Vrm88WrGzSmdIZxxhIq2rBfCV3RrHCaYCAXnpsglX iA4AIS56fw9RgKZ69jQWKsZ+tgvdnL9C0qN2YFMYQ2Zg2LgU1NHCvrXp7BQu/KjxCYc6 P3EQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:message-id :mime-version:subject:cc:to:date:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=d+D3Ks9DjcbBMGQmM5DQGKoueZnygfFj1KHN3YZGOa4=; b=vXOwJpzbeTVllSIhB+viCh470PEx51BAaUfAgEntt/+UPlLyUZpiHppxHG0i0SJjuO wq59UEFUMrXSednrvAVs5AL+RVffvXHudu0zY6ap7TuZvhFGLdly2K0xSypC+gpFfdQb VmiXGCFVz5D9BymrddQgR3e4mGvjwK9VimPT8/II25guVpBs3WUvTgg7XZJ9q7Msj6hc nGmgXc8P7iIrSWinHgRMeZLvKcz5Vtlsp57SoX0Y9fXQgGBFAeiRn6GuEmbUZIsIYYAa oMd9Vnzd6WV9q8aCVdtUCVh0/cJ2K2qbLHIOfMq/7up1/993gz+5nGzKcK8XQXYtO3Z4 Fv+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="eo1Wu+/a"; 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 b4-20020a5d40c4000000b002c5532bd6dasi13929237wrq.98.2023.03.23.09.01.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Mar 2023 09:01:17 -0700 (PDT) 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="eo1Wu+/a"; 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 3EABC38708A4 for ; Thu, 23 Mar 2023 16:01:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3EABC38708A4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1679587276; bh=d+D3Ks9DjcbBMGQmM5DQGKoueZnygfFj1KHN3YZGOa4=; h=Date:To:cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=eo1Wu+/ayXgafkPjVV+uNtQnnHWSqtnKI4h/IMKgXaSo+cKohxAmK6UmJ9qBulRRq Cl0ENTnZ5W37kBMFD1KjjneepNJ5mjWvMFq1Wsd53V6R26gu5uKEe59vIFfG7hwEk9 urDyrx4GL0GV1qEsExiJZguSo8SgZAUYtL4wuGYs= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id BB05E3858C31 for ; Thu, 23 Mar 2023 16:00:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BB05E3858C31 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 1BF42337DA; Thu, 23 Mar 2023 16:00:30 +0000 (UTC) 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 02D4813596; Thu, 23 Mar 2023 16:00:29 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Y3gQO513HGSnOAAAMHmgww (envelope-from ); Thu, 23 Mar 2023 16:00:29 +0000 Date: Thu, 23 Mar 2023 17:00:29 +0100 (CET) To: gcc-patches@gcc.gnu.org cc: Jakub Jelinek Subject: [PATCH] lto/109263 - lto-wrapper and -g0 -ggdb MIME-Version: 1.0 Message-Id: <20230323160030.02D4813596@imap2.suse-dmz.suse.de> X-Spam-Status: No, score=-11.8 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 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: Richard Biener via Gcc-patches From: Richard Biener Reply-To: Richard Biener 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?1761174909363883380?= X-GMAIL-MSGID: =?utf-8?q?1761174909363883380?= The following makes lto-wrapper deal with non-combined debug disabling / enabling option combinations properly. Interestingly -gno-dwarf also enables debug. Bootstrap / regtest running on x86_64-unknown-linux-gnu. OK? Or do we want to try harder to zap earlier -g0 when later -g* appear? PR lto/109263 * lto-wrapper.c (run_gcc): Parse alternate debug options as well, they always enable debug. --- gcc/lto-wrapper.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gcc/lto-wrapper.cc b/gcc/lto-wrapper.cc index fe8c5f6e80d..5186d040ce0 100644 --- a/gcc/lto-wrapper.cc +++ b/gcc/lto-wrapper.cc @@ -1564,6 +1564,16 @@ run_gcc (unsigned argc, char *argv[]) skip_debug = option->arg && !strcmp (option->arg, "0"); break; + case OPT_gbtf: + case OPT_gctf: + case OPT_gdwarf: + case OPT_gdwarf_: + case OPT_ggdb: + case OPT_gvms: + /* Negative forms, if allowed, enable debug info as well. */ + skip_debug = false; + break; + case OPT_dumpdir: incoming_dumppfx = dumppfx = option->arg; break;