From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 7A6AA385840E for ; Fri, 24 Nov 2023 16:04:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7A6AA385840E 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 7A6AA385840E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700841870; cv=none; b=e845JI95titUBRgWNgdBKebrRiSBVj5sU492FxomEqICbxnUCQEHEpa8tVikMR6N7u1KX7WDKDZtwfvVKnmDLroZJvRnXcX45fu0WZiVe7em6wBdOa9oiGv5+HpvBLP0b0O+5bInxre1RKfP33KS4Qc28V1z3lozD/q2moO+Xkg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700841870; c=relaxed/simple; bh=ofneDCgjSNmbTlhLgLSme+uNjGOktYOHppfN0E3Ez44=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=qeaHDMkOJDbm4cEZgN594/Xuq38r/RzpXfMHAfF2VqH7+r/OhkHNd4PWzJayAopdZDAZKTyNzVacWdDiPnYC0O+ZNGitb0JB7cCCRF2/0Skd/h43k3NPkxnC9k2co0gQWueFvV1rNyDzwiQaFcMveQXkg4Lq1A4P0RQm6tqa5DY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700841866; 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:in-reply-to:in-reply-to: references:references; bh=oEFtKlpkCaATRfzo91B7C2CnrLeTX5EH7b858W5o+MU=; b=bA95drlkprWeB1gK7sz1bUyIzcinGHb8KhArckiFWqRlAdrGSKXl2aJk91oFV9o6Pxdb85 3mEf/o/Y8j4EicWsPNuP/KXvwk9p2T3qop4NAunvRmx5rF/wjbUR4QXE7wqofxZm0cXV4V buPqDUOqO5WbPH5LI6rjFt1zEVwRP4E= 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-442-b022IJAGOkOlvTLerWv3xw-1; Fri, 24 Nov 2023 11:04:23 -0500 X-MC-Unique: b022IJAGOkOlvTLerWv3xw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (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 223BE1C06363; Fri, 24 Nov 2023 16:04:23 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.194.53]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D2CD81121306; Fri, 24 Nov 2023 16:04:22 +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 3AOG4Keb3470946 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 24 Nov 2023 17:04:20 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 3AOG4JoF3470945; Fri, 24 Nov 2023 17:04:19 +0100 Date: Fri, 24 Nov 2023 17:04:19 +0100 From: Jakub Jelinek To: Lewis Hyatt Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] preprocessor: Reinitialize frontend parser after loading a PCH [PR112319] Message-ID: Reply-To: Jakub Jelinek References: <20231101215457.3935908-1-lhyatt@gmail.com> MIME-Version: 1.0 In-Reply-To: <20231101215457.3935908-1-lhyatt@gmail.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 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.7 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_H3,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 List-Id: On Wed, Nov 01, 2023 at 05:54:57PM -0400, Lewis Hyatt wrote: > Since r14-2893, the frontend parser object needs to exist when running in > preprocess-only mode, because pragma_lex() is now called in that mode and > needs to make use of it. This is handled by calling c_init_preprocess() at > startup. If -fpch-preprocess is in effect (commonly, because of > -save-temps), a PCH file may be loaded during preprocessing, in which > case the parser will be destroyed, causing the issue noted in the > PR. Resolve it by reinitializing the frontend parser after loading the PCH. > > gcc/c-family/ChangeLog: > > PR pch/112319 > * c-ppoutput.cc (cb_read_pch): Reinitialize the frontend parser > after loading a PCH. > > gcc/testsuite/ChangeLog: > > PR pch/112319 > * g++.dg/pch/pr112319.C: New test. > * g++.dg/pch/pr112319.Hs: New test. > * gcc.dg/pch/pr112319.c: New test. > * gcc.dg/pch/pr112319.hs: New test. LGTM. Jakub