This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [4.8, 4.9] Backport a PCH fix (PR pch/65550)


On June 12, 2015 1:20:19 PM GMT+02:00, Jakub Jelinek <jakub@redhat.com> wrote:
>Hi!
>
>Bootstrapped/regtested on 4.8 and 4.9 branches on x86_64-linux and
>i686-linux, ok for 4.8/4.9?

OK.

Thanks,
Richard.

>2015-06-12  Jakub Jelinek  <jakub@redhat.com>
>
>	Backported from mainline
>	2015-04-09  Richard Biener  <rguenther@suse.de>
>
>	PR pch/65550
>	* files.c (pch_open_file): Allow main and pre-included files
>	when trying to open a PCH.
>
>--- libcpp/files.c	(revision 221948)
>+++ libcpp/files.c	(revision 221949)
>@@ -291,11 +291,13 @@ pch_open_file (cpp_reader *pfile, _cpp_f
> 
>/* 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
>-      && !(pfile->all_files->implicit_preinclude
>-	   || pfile->all_files->next_file->implicit_preinclude))
>-    return false;
>+  for (_cpp_file *f = pfile->all_files; f; f = f->next_file)
>+    if (f->implicit_preinclude)
>+      continue;
>+    else if (f->main_file)
>+      break;
>+    else
>+      return false;
> 
>   flen = strlen (path);
>   len = flen + sizeof (extension);
>
>	Jakub



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]