public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.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 [thread overview] Message-ID: <bug-112319-4-Sl1YRwFHrB@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-112319-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112319 --- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Lewis Hyatt <lhyatt@gcc.gnu.org>: https://gcc.gnu.org/g:5d4abd9219dfa53b52b341255e99139bb6cad302 commit r14-5836-g5d4abd9219dfa53b52b341255e99139bb6cad302 Author: Lewis Hyatt <lhyatt@gmail.com> Date: Wed Nov 1 13:01:12 2023 -0400 preprocessor: Reinitialize frontend parser after loading a PCH [PR112319] 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.
next prev parent reply other threads:[~2023-11-24 21:26 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-10-31 17:14 [Bug pch/112319] New: " krebbel at gcc dot gnu.org 2023-10-31 17:58 ` [Bug pch/112319] " lhyatt at gcc dot gnu.org 2023-10-31 17:58 ` [Bug pch/112319] [14 Regression] " pinskia at gcc dot gnu.org 2023-11-01 21:56 ` lhyatt at gcc dot gnu.org 2023-11-02 8:29 ` rguenth at gcc dot gnu.org 2023-11-24 21:26 ` cvs-commit at gcc dot gnu.org [this message] 2023-11-24 21:27 ` lhyatt at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-112319-4-Sl1YRwFHrB@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).