From patchwork Fri May 19 14:48:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Pinski X-Patchwork-Id: 96472 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1292279vqo; Fri, 19 May 2023 07:49:47 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5uFj2M6/fH3N+My1w54WSB2ResJ0cJ2ZxIBeqoADbFLVxLYk/UZMovmbB6lel/bOjiV2Dq X-Received: by 2002:a17:906:6a0d:b0:96a:928c:d391 with SMTP id qw13-20020a1709066a0d00b0096a928cd391mr2344090ejc.4.1684507787087; Fri, 19 May 2023 07:49:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684507787; cv=none; d=google.com; s=arc-20160816; b=q1RXIasvU5HAA7h4VK9GBCOv5yOkkcYQQifDu1Z3ZIMjdcEvL2Hxb1YcxRujMmj1mh uo7qyAkiTTHNp5/YHAQR3UfWht4w7RsgW2umVljJ6dKqxCLgztmcF9ZgdQ84FoszcvES pFsgxwoSEaJFa3pMR0kTGRwq51gRZurL/3BpGA3bZ0qLqjahHoLZka7UIuBwAUXYoeHV IN44/En+k1GTEbIuq5WEXcLMQQZVlAWniKwmVjTHdu3n8fE9wfgq8r4MgCHY8ftDFezD 7X6dZQME3b3PSJRTamkGT8FVkNJj+RcwfPa2MkmPosFW6Wv0eF41C43gJNOVmcFXYVbO RsZA== 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 :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=GIWmVnwLcJhbNrficIUZvySaLAp3cpompFrES13p3LQ=; b=baxJCPrw6ssvhNABM2zQZwwUGvUfCEYLMosLmgfHH97YMsLqgxXjju3Rad4uzeA6wv J63dVc6cvFKbZ+ziG6fnUOAKUm8kTmxvO2Dytgb/tAqhAyLPexHby6L0zCGefr/Eflvh f+R7y/LNOy9TtWErNIY33WBVcIXAwWwKfjFP6iLDboTvuWSB/IF5lcDx76tAvwBf4Eqb cuvEr603X7fDgJkzPaNJegZh5xQGJe/ij5E9jkIloLXwKWSWTIzoG+MOojByFTFoOHP0 THvgmMkEtzb22gt6qC/zmpQprfmblaLi3lPQbU06+WEt4vdT936lhX4B9pXz0L0ffyYl fiHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=tu8sXbkb; 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 (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id v23-20020a170906489700b009672562ffadsi3223462ejq.136.2023.05.19.07.49.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 May 2023 07:49:47 -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=tu8sXbkb; 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 C689F385840D for ; Fri, 19 May 2023 14:49:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C689F385840D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684507785; bh=GIWmVnwLcJhbNrficIUZvySaLAp3cpompFrES13p3LQ=; h=To:CC:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=tu8sXbkbE+3NNXd5Zh6Gj2pHNUl40qfBOxhsECcyX1xIb/G2Ec49a81w8yTnpMElX 13ydXAFA39mWUfgw5ugvgD3ICcFb8F8SPM7+cO+OC+hlCX7cSzGH724ymxvF5+0Eo1 mJGCVUHXseHucs7i/SbtjyuPS8LfsS/5vHLbapew= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by sourceware.org (Postfix) with ESMTPS id 765F13858C41 for ; Fri, 19 May 2023 14:49:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 765F13858C41 Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34JE27ak021936 for ; Fri, 19 May 2023 07:48:59 -0700 Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3qp3mksnye-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Fri, 19 May 2023 07:48:59 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Fri, 19 May 2023 07:48:57 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Fri, 19 May 2023 07:48:57 -0700 Received: from vpnclient.wrightpinski.org.com (unknown [10.69.242.187]) by maili.marvell.com (Postfix) with ESMTP id 407943F704B; Fri, 19 May 2023 07:48:57 -0700 (PDT) To: CC: Andrew Pinski Subject: [PATCH] Fix driver/33980: Precompiled header file not removed on error Date: Fri, 19 May 2023 07:48:48 -0700 Message-ID: <20230519144848.1873152-1-apinski@marvell.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-Proofpoint-GUID: 55a6ctiatYAzbfxa-PS5yQJMRV8gFHmM X-Proofpoint-ORIG-GUID: 55a6ctiatYAzbfxa-PS5yQJMRV8gFHmM X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-19_10,2023-05-17_02,2023-02-09_01 X-Spam-Status: No, score=-14.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Andrew Pinski via Gcc-patches From: Andrew Pinski Reply-To: Andrew Pinski 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?1766334437277036651?= X-GMAIL-MSGID: =?utf-8?q?1766334437277036651?= So the problem here is that in the spec files, we were not marking the pch output file to be removed on error. The way to fix this is to mark the --output-pch argument as the output file argument. For the C++ specs file, we had to move around where the %V was located such that it would be after the %w marker as %V marker clears the outputfiles. OK? Bootstrapped and tested on x86_64-linux-gnu. gcc/cp/ChangeLog: PR driver/33980 * lang-specs.h ("@c++-header"): Add %w after the --output-pch. ("@c++-system-header"): Likewise. ("@c++-user-header"): Likewise. gcc/ChangeLog: PR driver/33980 * gcc.cc (default_compilers["@c-header"]): Add %w after the --output-pch. --- gcc/cp/lang-specs.h | 12 ++++++------ gcc/gcc.cc | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/gcc/cp/lang-specs.h b/gcc/cp/lang-specs.h index c591d155cc1..94bdd4dcc4a 100644 --- a/gcc/cp/lang-specs.h +++ b/gcc/cp/lang-specs.h @@ -53,9 +53,9 @@ along with GCC; see the file COPYING3. If not see " %{fmodules-ts:-fmodule-header %{fpreprocessed:-fdirectives-only}}" " %(cc1_options) %2" " %{!fsyntax-only:" - " %{!S:-o %g.s%V}" + " %{!S:-o %g.s}" " %{!fmodule-*:%{!fmodules-*:%{!fdump-ada-spec*:" - " %{!o*:--output-pch %i.gch}%W{o*:--output-pch %*}}}}}" + " %{!o*:--output-pch %w%i.gch}%W{o*:--output-pch %w%*}}}}%{!S:%V}}" "}}}", CPLUSPLUS_CPP_SPEC, 0, 0}, {"@c++-system-header", @@ -74,9 +74,9 @@ along with GCC; see the file COPYING3. If not see " %{fpreprocessed:-fdirectives-only}}" " %(cc1_options) %2" " %{!fsyntax-only:" - " %{!S:-o %g.s%V}" + " %{!S:-o %g.s}" " %{!fmodule-*:%{!fmodules-*:%{!fdump-ada-spec*:" - " %{!o*:--output-pch %i.gch}%W{o*:--output-pch %*}}}}}" + " %{!o*:--output-pch %w%i.gch}%W{o*:--output-pch %w%*}}}}%{!S:%V}}" "}}}", CPLUSPLUS_CPP_SPEC, 0, 0}, {"@c++-user-header", @@ -94,9 +94,9 @@ along with GCC; see the file COPYING3. If not see " %{fmodules-ts:-fmodule-header=user %{fpreprocessed:-fdirectives-only}}" " %(cc1_options) %2" " %{!fsyntax-only:" - " %{!S:-o %g.s%V}" + " %{!S:-o %g.s}" " %{!fmodule-*:%{!fmodules-*:%{!fdump-ada-spec*:" - " %{!o*:--output-pch %i.gch}%W{o*:--output-pch %*}}}}}" + " %{!o*:--output-pch %w%i.gch}%W{o*:--output-pch %w%*}}}}%{!S:%V}}" "}}}", CPLUSPLUS_CPP_SPEC, 0, 0}, {"@c++", diff --git a/gcc/gcc.cc b/gcc/gcc.cc index 39a44fa486d..2ccca00d603 100644 --- a/gcc/gcc.cc +++ b/gcc/gcc.cc @@ -1454,13 +1454,13 @@ static const struct compiler default_compilers[] = cc1 -fpreprocessed %{save-temps*:%b.i} %{!save-temps*:%g.i} \ %(cc1_options)\ %{!fsyntax-only:%{!S:-o %g.s} \ - %{!fdump-ada-spec*:%{!o*:--output-pch %i.gch}\ - %W{o*:--output-pch %*}}%V}}\ + %{!fdump-ada-spec*:%{!o*:--output-pch %w%i.gch}\ + %W{o*:--output-pch %w%*}}%{!S:%V}}}\ %{!save-temps*:%{!traditional-cpp:%{!no-integrated-cpp:\ cc1 %(cpp_unique_options) %(cc1_options)\ %{!fsyntax-only:%{!S:-o %g.s} \ - %{!fdump-ada-spec*:%{!o*:--output-pch %i.gch}\ - %W{o*:--output-pch %*}}%V}}}}}}}", 0, 0, 0}, + %{!fdump-ada-spec*:%{!o*:--output-pch %w%i.gch}\ + %W{o*:--output-pch %w%*}}%{!S:%V}}}}}}}}", 0, 0, 0}, {".i", "@cpp-output", 0, 0, 0}, {"@cpp-output", "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},