From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 887753858C35; Fri, 24 Nov 2023 21:26:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 887753858C35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1700861189; bh=wEBwP9Njni+vhU+X6pYgW3/fw4uRiLkur70+Gu7SOAk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=WZgX+rA/3jTGp6LWb8Swx/pqWQ4ZyMtltKcqitFysWcxoX74esN7kgpJpzCKeWCaP flrCPG/QPXhB771fHXD8ze6h9AThO3VOXjwWCNemxW5buav3l6yDya/ampVw51vi6y DDhVvE/oNbr3yjufZSXPrYupdGyPrchCg6mtHG08= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug pch/112319] [14 Regression] segfault with pch and #pragma GCC diagnostic Date: Fri, 24 Nov 2023 21:26:28 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: pch X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: ice-on-valid-code, patch X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D112319 --- Comment #3 from CVS Commits --- The master branch has been updated by Lewis Hyatt : https://gcc.gnu.org/g:5d4abd9219dfa53b52b341255e99139bb6cad302 commit r14-5836-g5d4abd9219dfa53b52b341255e99139bb6cad302 Author: Lewis Hyatt Date: Wed Nov 1 13:01:12 2023 -0400 preprocessor: Reinitialize frontend parser after loading a PCH [PR11231= 9] 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 a= nd 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.=