Commit 9a8a2b7a by Richard Guenther Committed by Richard Biener

re PR preprocessor/38987 (Including a precompiled header from another header…

re PR preprocessor/38987 (Including a precompiled header from another header causes invalid assembly to be generated)

2009-09-22  Richard Guenther  <rguenther@suse.de>

	PR pch/38987
	* files.c (pch_open_file): Disallow non-toplevel PCH inclusion.

From-SVN: r151970
parent f61e18ec
2009-09-22 Richard Guenther <rguenther@suse.de>
PR pch/38987
* files.c (pch_open_file): Disallow non-toplevel PCH inclusion.
2009-09-18 Chris Demetriou <cgd@google.com> 2009-09-18 Chris Demetriou <cgd@google.com>
PR preprocessor/28435: PR preprocessor/28435:
......
...@@ -288,6 +288,12 @@ pch_open_file (cpp_reader *pfile, _cpp_file *file, bool *invalid_pch) ...@@ -288,6 +288,12 @@ pch_open_file (cpp_reader *pfile, _cpp_file *file, bool *invalid_pch)
if (file->name[0] == '\0' || !pfile->cb.valid_pch) if (file->name[0] == '\0' || !pfile->cb.valid_pch)
return false; return false;
/* If the file is not included as first include from either the toplevel
file or the command-line it is not a valid use of PCH. */
if (pfile->all_files
&& pfile->all_files->next_file)
return false;
flen = strlen (path); flen = strlen (path);
len = flen + sizeof (extension); len = flen + sizeof (extension);
pchname = XNEWVEC (char, len); pchname = XNEWVEC (char, len);
......
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