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 From patchwork Fri Mar 24 10:20:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 74476 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp512895vqo; Fri, 24 Mar 2023 03:21:46 -0700 (PDT) X-Google-Smtp-Source: AKy350Za9EHy72KBaauFedmVX7kdFCcqKuWA7U5QG4C6UVFRkb0Jap7wjo/PfQ4PanbVZ8ONLH4g X-Received: by 2002:a17:906:a21a:b0:931:3cbe:3778 with SMTP id r26-20020a170906a21a00b009313cbe3778mr2005189ejy.58.1679653306578; Fri, 24 Mar 2023 03:21:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679653306; cv=none; d=google.com; s=arc-20160816; b=tMKqS8KyA/+68IS1oiFl4Piitl4GDaTnr1UwXBGiBKDS/MQfxz3jiBa56nu3EEPtVN XgSsYOgoxNh+7aRN5zXUAB8LOloECO6CJgLU8d80xVRand/ssZv9yg4niGXlbzD1etEE paLg8qiaWb7cIJ6lSrFZkvkufUm+HlWGWKBzOa9sIgPK95pKdnJjqEwxMU5ZoWEoda/Q efjo+YwpKt/sxeOnPMKybAh1mB3MnXf/dw28bZDQvs0geqtr3dCeWysS3JCnx8bzkd9t XV7s9KrFlRQSyU1WLPQP8LpYm1E2TrUkCjZmwNRIP5pGcmI1z5t9/nDEgML9NSdVKuhV px3A== 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=RXcBjTbVHHM2eHwdlD+uVxbMBm7S+jyF7X7ecHb0CwM=; b=cajZ7Cu1UJQnu8FD3ld+aaff/IE4uW24kz8pLbPXhfAIn5uz3yfkJPv1y3sjcE+yCf yphZluZXeqj6LVrZ+xrC9/mtr3Pxnpwj8ByZiNSqpqp0g92KLIFtMLdtkIXwZxDH0axR EYuyXB59Se8RUdZ3WX/YngD2LoB8YdD1D8XNq5mGVQQBM+aVYndxVI5MNch2zqH5CBGg QUKPEoGf/8pc74UtBTJToWOSyac1/kW5k/Xq+ZTrznyTChDncfCxouXGAQDoDoeTdjhu tDtINaHrzm5JHc8OzW8IZA8jnrHXQ3QSlITgRS/WqmP+L28AQB72qkTNfdzC7Tk2VAoN lwGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=bKu1PFDh; 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 tf13-20020a1709078d8d00b0093e79e46252si530383ejc.1036.2023.03.24.03.21.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Mar 2023 03:21:45 -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=bKu1PFDh; 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 5D4C63858436 for ; Fri, 24 Mar 2023 10:21:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5D4C63858436 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1679653288; bh=RXcBjTbVHHM2eHwdlD+uVxbMBm7S+jyF7X7ecHb0CwM=; h=Date:To:cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=bKu1PFDhftjIeo1x0N/2pPqs/2whEtzyoQKEfTAzbnDNg6hyj0Xr0EIc3jT7l8Wvg iSZOeQZ6XA0rxujMJ1qIMQg8m/fsI9YPCk4ZZeqnToprIkCPsyT8lEmygjs8Jw9dPh HZ+Rda645oqUiYb1DEWS4rvlequh9bHSe5Xwzetk= 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 [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id C13813870898 for ; Fri, 24 Mar 2023 10:20:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C13813870898 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 E491933A30; Fri, 24 Mar 2023 10:20:09 +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 C79A5138F1; Fri, 24 Mar 2023 10:20:09 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id XWodL1l5HWTwPAAAMHmgww (envelope-from ); Fri, 24 Mar 2023 10:20:09 +0000 Date: Fri, 24 Mar 2023 11:20:09 +0100 (CET) To: gcc-patches@gcc.gnu.org cc: "Joseph S. Myers" , Jakub Jelinek Subject: [PATCH 2/2] Remove Negative(gwarf-) from gdwarf MIME-Version: 1.0 Message-Id: <20230324102009.C79A5138F1@imap2.suse-dmz.suse.de> X-Spam-Status: No, score=-11.7 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?1761244144432377974?= X-GMAIL-MSGID: =?utf-8?q?1761244144432377974?= Prior to the removal of STABS support the gdwarf, gstabs, ... options formed a cycle with their Negative(..) option attribute. But that didn't actually have any effect since most of the options also are Joined or JoinedOrMissing for which there's no pruning of options and so once ran into the set_debug_level diagnostics reporting conflicting debug formats. The following removes the remains of that cycle, which is a Negative option from gdwarf to gdwarf-. With RejectNegative added the expected effect of -gdwarf-4 -gdwarf would be to enable DWARF5 support (but this doesn't happen for some reason). I think the more sensible behavior is that seen and implemented in opts.cc, the more specific -gdwarf-4 determines the DWARF level and a later or earlier -gdwarf becomes a no-op. So the Negative(..) annotation on gdwarf is just confusing. Bootstrapped and tested on x86_64-unknown-linux-gnu, OK? Thanks, Richard. * common.opt (gdwarf): Remove Negative(gdwarf-). --- gcc/common.opt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/common.opt b/gcc/common.opt index 4546acb5b81..862c474d3c8 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -3349,7 +3349,7 @@ Common Driver RejectNegative JoinedOrMissing Generate BTF debug information at default level. gdwarf -Common Driver JoinedOrMissing Negative(gdwarf-) RejectNegative +Common Driver JoinedOrMissing RejectNegative Generate debug information in default version of DWARF format. gdwarf-