From patchwork Thu Dec 7 07:53:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 174983 Return-Path: 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 (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 ; 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 ; 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 To: Jason Merrill , "Joseph S. Myers" , Marek Polacek Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] c-family: Fix up -fno-debug-cpp [PR111965] Message-ID: 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-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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Jakub Jelinek 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 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 Jakub Jelinek PR preprocessor/111965 gcc/c-family/ * c-opts.cc (c_common_handle_option) : 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 --- 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:;F:;" } } */ +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:;F:;" } } */ +int x;