aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/c-family/ChangeLog6
-rw-r--r--gcc/c-family/c-lex.c7
-rw-r--r--gcc/c/ChangeLog7
-rw-r--r--gcc/c/c-parser.c2
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/parser.c5
-rw-r--r--gcc/ggc-page.c5
8 files changed, 36 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 62aebf2..86669dd 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2019-08-23 Iain Sandoe <iain@sandoe.co.uk>
+
+ PR pch/61250
+ * ggc-page.c (ggc_pch_read): Read the ggc_pch_ondisk structure
+ and issue any diagnostics needed before collecting the pre-PCH
+ state.
+
2019-08-23 Jakub Jelinek <jakub@redhat.com>
PR middle-end/91283
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index b8920f1c..2ab1c98 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,9 @@
+2019-08-23 Iain Sandoe <iain@sandoe.co.uk>
+
+ PR pch/61250
+ * c-lex.c (c_lex_with_flags): Don't call
+ c_common_no_more_pch () from here.
+
2019-08-23 Jakub Jelinek <jakub@redhat.com>
PR middle-end/91283
diff --git a/gcc/c-family/c-lex.c b/gcc/c-family/c-lex.c
index 851fd70..e3c602f 100644
--- a/gcc/c-family/c-lex.c
+++ b/gcc/c-family/c-lex.c
@@ -394,7 +394,6 @@ enum cpp_ttype
c_lex_with_flags (tree *value, location_t *loc, unsigned char *cpp_flags,
int lex_flags)
{
- static bool no_more_pch;
const cpp_token *tok;
enum cpp_ttype type;
unsigned char add_flags = 0;
@@ -628,12 +627,6 @@ c_lex_with_flags (tree *value, location_t *loc, unsigned char *cpp_flags,
if (cpp_flags)
*cpp_flags = tok->flags | add_flags;
- if (!no_more_pch)
- {
- no_more_pch = true;
- c_common_no_more_pch ();
- }
-
timevar_pop (TV_CPP);
return type;
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index 0b3dc74..b7b45f5 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,10 @@
+2019-08-23 Iain Sandoe <iain@sandoe.co.uk>
+
+ PR pch/61250
+ * c-parser.c (c_parse_file): Call c_common_no_more_pch ()
+ after determining that the first token is not
+ PRAGMA_GCC_PCH_PREPROCESS.
+
2019-08-22 Eric Botcazou <ebotcazou@adacore.com>
* c-parser.c (c_parser_declaration_or_fndef): Set DECL_ARGUMENTS of a
diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c
index 7397f53..6070502 100644
--- a/gcc/c/c-parser.c
+++ b/gcc/c/c-parser.c
@@ -20263,6 +20263,8 @@ c_parse_file (void)
if (c_parser_peek_token (&tparser)->pragma_kind == PRAGMA_GCC_PCH_PREPROCESS)
c_parser_pragma_pch_preprocess (&tparser);
+ else
+ c_common_no_more_pch ();
the_parser = ggc_alloc<c_parser> ();
*the_parser = tparser;
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index d2b9623..f014423 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,10 @@
+2019-08-23 Iain Sandoe <iain@sandoe.co.uk>
+
+ PR pch/61250
+ * parser.c (cp_parser_initial_pragma): Call c_common_no_more_pch ()
+ after determining that the first token is not
+ PRAGMA_GCC_PCH_PREPROCESS.
+
2019-08-22 Marek Polacek <polacek@redhat.com>
PR c++/91304 - prefix attributes ignored in condition.
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index b410a6c..504f77a 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -41357,7 +41357,10 @@ cp_parser_initial_pragma (cp_token *first_token)
cp_lexer_get_preprocessor_token (NULL, first_token);
if (cp_parser_pragma_kind (first_token) != PRAGMA_GCC_PCH_PREPROCESS)
- return;
+ {
+ c_common_no_more_pch ();
+ return;
+ }
cp_lexer_get_preprocessor_token (NULL, first_token);
if (first_token->type == CPP_STRING)
diff --git a/gcc/ggc-page.c b/gcc/ggc-page.c
index a2736bc..220f20c 100644
--- a/gcc/ggc-page.c
+++ b/gcc/ggc-page.c
@@ -2556,6 +2556,9 @@ ggc_pch_read (FILE *f, void *addr)
count_old_page_tables = G.by_depth_in_use;
+ if (fread (&d, sizeof (d), 1, f) != 1)
+ fatal_error (input_location, "cannot read PCH file: %m");
+
/* We've just read in a PCH file. So, every object that used to be
allocated is now free. */
clear_marks ();
@@ -2584,8 +2587,6 @@ ggc_pch_read (FILE *f, void *addr)
/* Allocate the appropriate page-table entries for the pages read from
the PCH file. */
- if (fread (&d, sizeof (d), 1, f) != 1)
- fatal_error (input_location, "cannot read PCH file: %m");
for (i = 0; i < NUM_ORDERS; i++)
{