From patchwork Fri Mar 24 10:19:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 74474 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp512302vqo; Fri, 24 Mar 2023 03:20:31 -0700 (PDT) X-Google-Smtp-Source: AKy350a9g335euZUhhMT8XI3Ks8G4Od6srafBBP8k8/j0AdRxOxQTsL5TEmauJCSxnSO6ztQYHsJ X-Received: by 2002:a05:6402:1002:b0:4fc:183d:ee18 with SMTP id c2-20020a056402100200b004fc183dee18mr2130556edu.35.1679653231388; Fri, 24 Mar 2023 03:20:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679653231; cv=none; d=google.com; s=arc-20160816; b=tiDO1hoddeUn/ILdiIyj+JV8CeXCAjgy44WfqaJ5ACKhHWGOJoqzBTr0cuPRJ4h3fj Fw+4xq78NufZlVfqaFgOHpqGOqrGHnwHo0Dw/xqiw8U4QxQqdMC7hl1doT/DvYyrj1Qb VG4aQU8TUVYLpTHRZnrax5fbDhR/cAPp7bwUiVqPocUU9TvNC/wSN6KKMS+ZVWBufmHg EAJSmFdbl/Bkcv1IUvT/lNrnh/Z6ZRboYQKLowS6MjuiZ/YvDCoW0VEku37JEBitM2WT 46DTTNWTkUOChdu1m9xtVCpCSj6vUnmnzwVo6dcSVVslNGxLPES48XS1md5dKYEAWGVn IxZw== 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=jbGE8So3Rdv189xpmIP43kLj7BklE0PttTtHvZ8TkzI=; b=tFRvibVfaWTrlh53OLvVD+V0gSzaOBy3s/EGdo1/onQ9Xj0v4e+kaJRiK+FzTX+qK0 Z/w3Gr5BmRxbchyavheTUEvnedqD1Rd4wt9Oh9DFctEd9xXjdSh6zLykyVSR7c0SN39P nhfKZa7KAtZnW/4Na/pYbWmfy/rnMA92nldUmBEsIdbdvBr+A5HpoRUjWYy/mZJcPC1T dzsIlLiKGzdHy2KTsHqPEA823u73myjGhNkpTbKcy0oVfWcR3gyBLyW7BF0Gebb+k5UU pS7IPQqn8XyVkNj6kf3F2nDnI3V8v1cnKOa2MOzZPENMwtWKedKCtvtbVG2dJ6X5IfwJ xTIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=e7n0yc8i; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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 (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id w12-20020a50fa8c000000b004ff081c3880si21934219edr.475.2023.03.24.03.20.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Mar 2023 03:20:31 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=e7n0yc8i; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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 4F8D0385AC29 for ; Fri, 24 Mar 2023 10:20:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4F8D0385AC29 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1679653230; bh=jbGE8So3Rdv189xpmIP43kLj7BklE0PttTtHvZ8TkzI=; h=Date:To:cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=e7n0yc8ihiskdeaERHjOEJkWTFXNP4XRcEsU38k6FV9/68OVBN48MA/7FEN7S8Ktk L3JJ/Lp40Iu7sn9Tt+T8nMel6vR475pzc4kwVwQK6bthblMILU0JC1F3zfPo4pd5j2 Rl1KilIiKj8KGDE57tWAf/10CzMfI4NPwRlvTokQ= 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 D9A193858D28 for ; Fri, 24 Mar 2023 10:19:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D9A193858D28 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 986EF219BE; Fri, 24 Mar 2023 10:19:42 +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 7978E138ED; Fri, 24 Mar 2023 10:19:42 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id p/+IHD55HWSjPAAAMHmgww (envelope-from ); Fri, 24 Mar 2023 10:19:42 +0000 Date: Fri, 24 Mar 2023 11:19:42 +0100 (CET) To: gcc-patches@gcc.gnu.org cc: "Joseph S. Myers" , Jakub Jelinek Subject: [PATCH 1/2] Disallow -gno-dwarf, gno-dwarf-N, -gno-gdb and -gno-vms MIME-Version: 1.0 Message-Id: <20230324101942.7978E138ED@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?1761244066635356483?= X-GMAIL-MSGID: =?utf-8?q?1761244066635356483?= The following adds RejectNegative to the gdwarf, gdwarf-, ggdb and gvms options since the current behavior is to treat the negative variant the same as the positive variant. In particular -ggdb -gno-gdb do not cancel, and plain -gno-dwarf will enable (dwarf!) debug output. Rejecting the negative forms avoids interpreting sensible behavior to combinations of options like -gdwarf-5 -gno-dwarf-3 and sticks to the behavior that later -g options simply override earlier ones and the only negative form is -g0. Bootstrapped and tested on x86_64-unknown-linux-gnu, OK? Thanks, Richard. * common.opt (gdwarf): Add RejectNegative. (gdwarf-): Likewise. (ggdb): Likewise. (gvms): Likewise. --- gcc/common.opt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gcc/common.opt b/gcc/common.opt index e558385c7f4..4546acb5b81 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -3349,11 +3349,11 @@ Common Driver RejectNegative JoinedOrMissing Generate BTF debug information at default level. gdwarf -Common Driver JoinedOrMissing Negative(gdwarf-) +Common Driver JoinedOrMissing Negative(gdwarf-) RejectNegative Generate debug information in default version of DWARF format. gdwarf- -Common Driver Joined UInteger Var(dwarf_version) Init(DWARF_VERSION_DEFAULT) +Common Driver Joined UInteger Var(dwarf_version) Init(DWARF_VERSION_DEFAULT) RejectNegative Generate debug information in DWARF v2 (or later) format. gdwarf32 @@ -3365,7 +3365,7 @@ Common Driver Var(dwarf_offset_size,8) RejectNegative Use 64-bit DWARF format when emitting DWARF debug information. ggdb -Common Driver JoinedOrMissing +Common Driver JoinedOrMissing RejectNegative Generate debug information in default extended format. ginline-points @@ -3432,7 +3432,7 @@ gvariable-location-views=incompat5 Common Driver RejectNegative Var(debug_variable_location_views, -1) Init(2) gvms -Common Driver JoinedOrMissing +Common Driver JoinedOrMissing RejectNegative Generate debug information in VMS format. gxcoff