Commit b3e200e1 by Jakub Jelinek

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
parent 035b2a77
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> 2008-07-30 Eric Botcazou <ebotcazou@adacore.com>
PR ada/36554 PR ada/36554
...@@ -6,7 +12,7 @@ ...@@ -6,7 +12,7 @@
2008-07-30 Rafael Avila de Espindola <espindola@google.com> 2008-07-30 Rafael Avila de Espindola <espindola@google.com>
PR 36974 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> 2008-07-30 H.J. Lu <hongjiu.lu@intel.com>
......
...@@ -367,6 +367,7 @@ c_common_read_pch (cpp_reader *pfile, const char *name, ...@@ -367,6 +367,7 @@ c_common_read_pch (cpp_reader *pfile, const char *name,
struct c_pch_header h; struct c_pch_header h;
struct save_macro_data *smd; struct save_macro_data *smd;
expanded_location saved_loc; expanded_location saved_loc;
bool saved_trace_includes;
f = fdopen (fd, "rb"); f = fdopen (fd, "rb");
if (f == NULL) if (f == NULL)
...@@ -412,6 +413,7 @@ c_common_read_pch (cpp_reader *pfile, const char *name, ...@@ -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. */ /* Save the location and then restore it after reading the PCH. */
saved_loc = expand_location (line_table->highest_line); saved_loc = expand_location (line_table->highest_line);
saved_trace_includes = line_table->trace_includes;
cpp_prepare_state (pfile, &smd); cpp_prepare_state (pfile, &smd);
...@@ -425,6 +427,7 @@ c_common_read_pch (cpp_reader *pfile, const char *name, ...@@ -425,6 +427,7 @@ c_common_read_pch (cpp_reader *pfile, const char *name,
fclose (f); fclose (f);
line_table->trace_includes = saved_trace_includes;
cpp_set_line_map (pfile, line_table); cpp_set_line_map (pfile, line_table);
linemap_add (line_table, LC_RENAME, 0, saved_loc.file, saved_loc.line); linemap_add (line_table, LC_RENAME, 0, saved_loc.file, saved_loc.line);
......
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> 2008-07-30 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/boolean_expr.ad[sb]: New test. * gnat.dg/boolean_expr.ad[sb]: New test.
......
/* 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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment