public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Lewis Hyatt <lhyatt@gmail.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] preprocessor: Reinitialize frontend parser after loading a PCH [PR112319]
Date: Fri, 24 Nov 2023 17:04:19 +0100	[thread overview]
Message-ID: <ZWDJgxLs25pGkyMV@tucnak> (raw)
In-Reply-To: <20231101215457.3935908-1-lhyatt@gmail.com>

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


  parent reply	other threads:[~2023-11-24 16:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-01 21:54 Lewis Hyatt
2023-11-17 14:16 ` ping: " Lewis Hyatt
2023-11-24 16:04 ` Jakub Jelinek [this message]
2023-11-30 21:19 ` Marek Polacek
2023-11-30 22:20   ` Lewis Hyatt

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=ZWDJgxLs25pGkyMV@tucnak \
    --to=jakub@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=lhyatt@gmail.com \
    /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: link
Be 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).