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: PATCH to defer cpp_read_main_file and related changes


Per Bothner wrote:
DJ Delorie wrote:

* c-lex.c (src_line): Remove unneeded static variable.

This patch broke -imacros :-(


$ ./cc1 -quiet -imacros dj.h dj.c
<command line>:2: internal compiler error: Segmentation fault

I had a patch for this, but it appears to cause many regressions. I'll look further for a solution ...

Actually the patche reduced the number of regressions (there were just a lot of unexpected failures), so I checked it in. Here it is.
--
--Per Bothner
per@bothner.com http://per.bothner.com/


2003-11-02  Per Bothner  <per@bothner.com>

	* c-opts.c (needValue):  Do cpp_find_main_file before processing
	any imacros flags, so pfile->main_file is set for the latter.

Index: c-opts.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-opts.c,v
retrieving revision 1.92
diff -u -p -r1.92 c-opts.c
--- c-opts.c	1 Nov 2003 03:19:58 -0000	1.92
+++ c-opts.c	3 Nov 2003 07:13:37 -0000
@@ -1392,6 +1392,10 @@ add_prefixed_path (const char *suffix, s
 static bool
 finish_options (const char *tif)
 {
+  this_input_filename = tif;
+  if (! cpp_find_main_file (parse_in, this_input_filename))
+    return false;
+
   if (!cpp_opts->preprocessed)
     {
       size_t i;
@@ -1441,9 +1445,6 @@ finish_options (const char *tif)
     }
 
   include_cursor = 0;
-  this_input_filename = tif;
-  if (! cpp_find_main_file (parse_in, this_input_filename))
-    return false;
   push_command_line_include ();
   return true;
 }

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