Message ID | ZXF6Afn0+K3Mx+I7@tucnak |
---|---|
State | Unresolved |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp4616936vqy; Wed, 6 Dec 2023 23:54:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IEm7R/b32woGt80iEPQC+yCCw4PttyxPCxI+0qZZPyEPKiTGwNZ7BNdFHqQ8TzBilF3Qhw7 X-Received: by 2002:a05:620a:27c1:b0:77d:7446:d4df with SMTP id i1-20020a05620a27c100b0077d7446d4dfmr888056qkp.76.1701935647081; Wed, 06 Dec 2023 23:54:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1701935647; cv=pass; d=google.com; s=arc-20160816; b=jUQTn95xpSoBid1xNmKtWMKIaAl//v8wHS3g8mPYV+P96vnRCOIBYABBdup6oNllF3 DTRsE10MUqYmTlJo3YAM6sRGlk2SPnEkoIV5Yu/MaRKLOscXq0h9sutUlo7aGTrl1ejl W0ZkHFluypr2YfX+LuTtKE2zMiLlvV8rE5DwfTnttAIdEX0yiNhADQMQhUCGNnc8ODd5 VUVy5kGrKBvGGLWj2pucGka66NFDH91828LRNJuY00vyx5Vc2WqK3L7cIFjP17NUT4Ys /Ic0gNXc+Zk1nzy4rggmw5pbnGDw0WRSOxNBubQ1eEYpb/sKkzaS0GHjON3UU6GlINkT S/MQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:reply-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=jxX7WwA73a4XCJ30aQeIpkixK76bdqvXA2BrMQ2BLgQ=; fh=m7+AFjtMHmY1VH/2i/gazAmSZUYZ+OGccUIZLGLtbCM=; b=JPi1jWpGREA0H7fwRAcWv/itEB6VfMmseznPP0up4Mqt5HU2EJ5Rnrz3zgjmEB2lm8 bVJ1kkZiLlOr88Dsv/cB9j+TQR+8oZJnoyXI7H7z1jWngxca7Ej7AGitArsQ8UcdFspR k+piVUHvTqWHrBDLiuZpTWIxihNIlZyMsvDOQe2Xv3TTiRUHCbyjbwtOl8ZKPBBZO1Sn 5cRtorLy+xhQ+iZejKFiov7DRG81OVcfzAMquZzufA/N+uH+8WmR0h3XYLTEE1qudaAZ D3laBnVvPtKYx6iWBmarwg44sEG5kR3Z8PJseLFrtUyNwA5udafKFnLtbSx+pbkd9AcO 37nw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=F9SqXlNn; arc=pass (i=1); 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=redhat.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id x17-20020a05620a099100b0077f2620442csi714857qkx.771.2023.12.06.23.54.07 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 23:54:07 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=F9SqXlNn; arc=pass (i=1); 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=redhat.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D5112385E036 for <ouuuleilei@gmail.com>; Thu, 7 Dec 2023 07:54:06 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 984B4385BC13 for <gcc-patches@gcc.gnu.org>; Thu, 7 Dec 2023 07:53:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 984B4385BC13 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 984B4385BC13 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701935624; cv=none; b=oT24GBwYUH3sLk6LmHRk8RcRPZZoHu1tLi7t95WjzYAGURPAZlDVdypprLZoNc242ML5ucIeM6yR+1RBjfmBzoec5b6QhkjlRBZ0wALCJqbAlCD9CNKxPfsruWZPeCUInF+r+YbQs8IvE+6NHBd3Qsk5is0Qtv/BQCff7oQYAPM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701935624; c=relaxed/simple; bh=QHyigxbOHTCKVxT6KL/r5Humu779f7OSieEQ5nvMQ1k=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=TH36yze5SY27m4zGtrxshjsKaqDwiVsE6+KFWrrHQZtPQ19e0kVzm20KNKPxcvdOcmZjsQcl+J1dNnRszMOfl3U9Pa7rFntIxsk68krNBp6fILEtXyTh3CYLxxyUcM57ivsxsQqIA6rrvkC1wflco2AhTKgzLVpOSVNFoGdec4Y= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701935623; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type; bh=jxX7WwA73a4XCJ30aQeIpkixK76bdqvXA2BrMQ2BLgQ=; b=F9SqXlNn/4WQQqoSJbG7beepkwC5V8afR8uxilbOxR01XCIv6J/hWK1/62erYINgm2Fh3d R5L1nueRZ+yizO10fybuYR+09pIo37ZNP1JPcpBLjrcmTLpYTiNgUzDoszB3dSa64OnIgJ k7C2YYDS2BQCHNQx2hkbu7HoOYT/cvQ= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-639-bnmymIRDOiinbNFRMKvj6Q-1; Thu, 07 Dec 2023 02:53:41 -0500 X-MC-Unique: bnmymIRDOiinbNFRMKvj6Q-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7D9681C01727; Thu, 7 Dec 2023 07:53:41 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.195.157]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1F5EF8CD0; Thu, 7 Dec 2023 07:53:41 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 3B77rcS5161858 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 7 Dec 2023 08:53:38 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 3B77rbkI161853; Thu, 7 Dec 2023 08:53:37 +0100 Date: Thu, 7 Dec 2023 08:53:37 +0100 From: Jakub Jelinek <jakub@redhat.com> To: Jason Merrill <jason@redhat.com>, "Joseph S. Myers" <joseph@codesourcery.com>, Marek Polacek <polacek@redhat.com> Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] c-family: Fix up -fno-debug-cpp [PR111965] Message-ID: <ZXF6Afn0+K3Mx+I7@tucnak> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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.30 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Reply-To: Jakub Jelinek <jakub@redhat.com> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784608872927724529 X-GMAIL-MSGID: 1784608872927724529 |
Series |
c-family: Fix up -fno-debug-cpp [PR111965]
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | warning | Git am fail log |
Commit Message
Jakub Jelinek
Dec. 7, 2023, 7:53 a.m. UTC
Hi! As can be seen in the second testcase, -fno-debug-cpp is actually implemented the same as -fdebug-cpp and so doesn't turn the debugging off. The following patch fixes that. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2023-12-07 Andrew Pinski <pinskia@gmail.com> Jakub Jelinek <jakub@redhat.com> PR preprocessor/111965 gcc/c-family/ * c-opts.cc (c_common_handle_option) <case OPT_fdebug_cpp>: Set cpp_opts->debug to value rather than 1. gcc/testsuite/ * gcc.dg/cpp/pr111965-1.c: New test. * gcc.dg/cpp/pr111965-2.c: New test. Jakub
Comments
On Thu, Dec 7, 2023 at 8:54 AM Jakub Jelinek <jakub@redhat.com> wrote: > > Hi! > > As can be seen in the second testcase, -fno-debug-cpp is actually > implemented the same as -fdebug-cpp and so doesn't turn the debugging > off. > > The following patch fixes that. > > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? OK > 2023-12-07 Andrew Pinski <pinskia@gmail.com> > Jakub Jelinek <jakub@redhat.com> > > PR preprocessor/111965 > gcc/c-family/ > * c-opts.cc (c_common_handle_option) <case OPT_fdebug_cpp>: Set > cpp_opts->debug to value rather than 1. > gcc/testsuite/ > * gcc.dg/cpp/pr111965-1.c: New test. > * gcc.dg/cpp/pr111965-2.c: New test. > > --- gcc/c-family/c-opts.cc.jj 2023-12-05 09:06:05.867881859 +0100 > +++ gcc/c-family/c-opts.cc 2023-12-06 18:02:20.445469185 +0100 > @@ -532,7 +532,7 @@ c_common_handle_option (size_t scode, co > break; > > case OPT_fdebug_cpp: > - cpp_opts->debug = 1; > + cpp_opts->debug = value; > break; > > case OPT_ftrack_macro_expansion: > --- gcc/testsuite/gcc.dg/cpp/pr111965-1.c.jj 2023-12-06 17:54:03.696424916 +0100 > +++ gcc/testsuite/gcc.dg/cpp/pr111965-1.c 2023-12-06 18:01:32.341142764 +0100 > @@ -0,0 +1,5 @@ > +/* PR preprocessor/111965 > + { dg-do preprocess } > + { dg-options "-fdebug-cpp" } > + { dg-final { scan-file pr111965-1.i "P:<built-in>;F:<NULL>;" } } */ > +int x; > --- gcc/testsuite/gcc.dg/cpp/pr111965-2.c.jj 2023-12-06 17:59:36.953758477 +0100 > +++ gcc/testsuite/gcc.dg/cpp/pr111965-2.c 2023-12-06 18:01:27.147215490 +0100 > @@ -0,0 +1,5 @@ > +/* PR preprocessor/111965 > + { dg-do preprocess } > + { dg-options "-fdebug-cpp -fno-debug-cpp" } > + { dg-final { scan-file-not pr111965-2.i "P:<built-in>;F:<NULL>;" } } */ > +int x; > > Jakub >
On Thu, Dec 07, 2023 at 08:53:37AM +0100, Jakub Jelinek wrote: > Hi! > > As can be seen in the second testcase, -fno-debug-cpp is actually > implemented the same as -fdebug-cpp and so doesn't turn the debugging > off. > > The following patch fixes that. > > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? Ok, thanks. > 2023-12-07 Andrew Pinski <pinskia@gmail.com> > Jakub Jelinek <jakub@redhat.com> > > PR preprocessor/111965 > gcc/c-family/ > * c-opts.cc (c_common_handle_option) <case OPT_fdebug_cpp>: Set > cpp_opts->debug to value rather than 1. > gcc/testsuite/ > * gcc.dg/cpp/pr111965-1.c: New test. > * gcc.dg/cpp/pr111965-2.c: New test. > > --- gcc/c-family/c-opts.cc.jj 2023-12-05 09:06:05.867881859 +0100 > +++ gcc/c-family/c-opts.cc 2023-12-06 18:02:20.445469185 +0100 > @@ -532,7 +532,7 @@ c_common_handle_option (size_t scode, co > break; > > case OPT_fdebug_cpp: > - cpp_opts->debug = 1; > + cpp_opts->debug = value; > break; > > case OPT_ftrack_macro_expansion: > --- gcc/testsuite/gcc.dg/cpp/pr111965-1.c.jj 2023-12-06 17:54:03.696424916 +0100 > +++ gcc/testsuite/gcc.dg/cpp/pr111965-1.c 2023-12-06 18:01:32.341142764 +0100 > @@ -0,0 +1,5 @@ > +/* PR preprocessor/111965 > + { dg-do preprocess } > + { dg-options "-fdebug-cpp" } > + { dg-final { scan-file pr111965-1.i "P:<built-in>;F:<NULL>;" } } */ > +int x; > --- gcc/testsuite/gcc.dg/cpp/pr111965-2.c.jj 2023-12-06 17:59:36.953758477 +0100 > +++ gcc/testsuite/gcc.dg/cpp/pr111965-2.c 2023-12-06 18:01:27.147215490 +0100 > @@ -0,0 +1,5 @@ > +/* PR preprocessor/111965 > + { dg-do preprocess } > + { dg-options "-fdebug-cpp -fno-debug-cpp" } > + { dg-final { scan-file-not pr111965-2.i "P:<built-in>;F:<NULL>;" } } */ > +int x; > > Jakub > Marek
--- gcc/c-family/c-opts.cc.jj 2023-12-05 09:06:05.867881859 +0100 +++ gcc/c-family/c-opts.cc 2023-12-06 18:02:20.445469185 +0100 @@ -532,7 +532,7 @@ c_common_handle_option (size_t scode, co break; case OPT_fdebug_cpp: - cpp_opts->debug = 1; + cpp_opts->debug = value; break; case OPT_ftrack_macro_expansion: --- gcc/testsuite/gcc.dg/cpp/pr111965-1.c.jj 2023-12-06 17:54:03.696424916 +0100 +++ gcc/testsuite/gcc.dg/cpp/pr111965-1.c 2023-12-06 18:01:32.341142764 +0100 @@ -0,0 +1,5 @@ +/* PR preprocessor/111965 + { dg-do preprocess } + { dg-options "-fdebug-cpp" } + { dg-final { scan-file pr111965-1.i "P:<built-in>;F:<NULL>;" } } */ +int x; --- gcc/testsuite/gcc.dg/cpp/pr111965-2.c.jj 2023-12-06 17:59:36.953758477 +0100 +++ gcc/testsuite/gcc.dg/cpp/pr111965-2.c 2023-12-06 18:01:27.147215490 +0100 @@ -0,0 +1,5 @@ +/* PR preprocessor/111965 + { dg-do preprocess } + { dg-options "-fdebug-cpp -fno-debug-cpp" } + { dg-final { scan-file-not pr111965-2.i "P:<built-in>;F:<NULL>;" } } */ +int x;