re PR preprocessor/36649 (-H option doesn't work as expected)

PR preprocessor/36649
	* c-pch.c (c_common_read_pch): Save and restore
	line_table->trace_includes across PCH restore.

	* gcc.dg/pch/cpp-3.c: New test.
	* gcc.dg/pch/cpp-3.hs: New file.
	* gcc.dg/pch/cpp-3a.h: New file.
	* gcc.dg/pch/cpp-3b.h: New file.

From-SVN: r138360
This commit is contained in:
Jakub Jelinek 2008-07-31 09:59:18 +02:00
parent 035b2a7777
commit b3e200e135
7 changed files with 31 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2008-07-31 Jakub Jelinek <jakub@redhat.com>
PR preprocessor/36649
* c-pch.c (c_common_read_pch): Save and restore
line_table->trace_includes across PCH restore.
2008-07-30 Eric Botcazou <ebotcazou@adacore.com>
PR ada/36554
@ -6,7 +12,7 @@
2008-07-30 Rafael Avila de Espindola <espindola@google.com>
PR 36974
* final.c (call_from_call_insn): Handle COND_EXEC
* final.c (call_from_call_insn): Handle COND_EXEC.
2008-07-30 H.J. Lu <hongjiu.lu@intel.com>

View File

@ -367,6 +367,7 @@ c_common_read_pch (cpp_reader *pfile, const char *name,
struct c_pch_header h;
struct save_macro_data *smd;
expanded_location saved_loc;
bool saved_trace_includes;
f = fdopen (fd, "rb");
if (f == NULL)
@ -412,6 +413,7 @@ c_common_read_pch (cpp_reader *pfile, const char *name,
/* Save the location and then restore it after reading the PCH. */
saved_loc = expand_location (line_table->highest_line);
saved_trace_includes = line_table->trace_includes;
cpp_prepare_state (pfile, &smd);
@ -425,6 +427,7 @@ c_common_read_pch (cpp_reader *pfile, const char *name,
fclose (f);
line_table->trace_includes = saved_trace_includes;
cpp_set_line_map (pfile, line_table);
linemap_add (line_table, LC_RENAME, 0, saved_loc.file, saved_loc.line);

View File

@ -1,3 +1,8 @@
2008-07-31 Jakub Jelinek <jakub@redhat.com>
PR debug/36278
* g++.dg/debug/namespace2.C: New test.
2008-07-30 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/boolean_expr.ad[sb]: New test.

View File

@ -0,0 +1,13 @@
/* PR preprocessor/36649 */
/* { dg-do compile } */
/* { dg-options "-H -I." } */
/* { dg-message "cpp-3.h\[^\n\]*(\n\[^\n\]*cpp-3.c)?\n\[^\n\]*cpp-3a.h\n\[^\n\]*cpp-3b.h" "" { target *-*-* } 0 } */
#include "cpp-3.h"
#include "cpp-3a.h"
int
main (void)
{
return 0;
}

View File

@ -0,0 +1 @@
/* empty */

View File

@ -0,0 +1 @@
#include "cpp-3b.h"

View File

@ -0,0 +1 @@
/* empty */