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: don't clobber dump files during preprocessing


On Nov 24, 2010, Richard Guenther <richard.guenther@gmail.com> wrote:

>> This is what the patch fixes: arrange for preprocessing-only compiles to
>> not call the pass finalizers that emit dump file summaries.

>> Regstrapped on x86_64-linux-gnu and i686-linux-gnu. ÂOk to install?

> Ok if you also move statistics_fini () inside the conditional.

Thanks, here's what I checked in.

for  gcc/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* toplev.c (finalize): Add no_backend parameter.  Don't finish
	passes when preprocessing only.  Adjust...
	(do_compile): ... caller.

Index: gcc/toplev.c
===================================================================
--- gcc/toplev.c.orig	2010-11-26 01:06:02.794840235 -0200
+++ gcc/toplev.c	2010-11-26 01:07:46.431592065 -0200
@@ -107,7 +107,7 @@ static void process_options (void);
 static void backend_init (void);
 static int lang_dependent_init (const char *);
 static void init_asm_output (const char *);
-static void finalize (void);
+static void finalize (bool);
 
 static void crash_signal (int) ATTRIBUTE_NORETURN;
 static void compile_file (void);
@@ -2139,7 +2139,7 @@ dump_memory_report (bool final)
 /* Clean up: close opened files, etc.  */
 
 static void
-finalize (void)
+finalize (bool no_backend)
 {
   /* Close the dump files.  */
   if (flag_gen_aux_info)
@@ -2166,10 +2166,14 @@ finalize (void)
   if (stack_usage_file)
     fclose (stack_usage_file);
 
-  statistics_fini ();
-  finish_optimization_passes ();
+  if (!no_backend)
+    {
+      statistics_fini ();
+
+      finish_optimization_passes ();
 
-  ira_finish_once ();
+      ira_finish_once ();
+    }
 
   if (mem_report)
     dump_memory_report (true);
@@ -2206,7 +2210,7 @@ do_compile (void)
       if (lang_dependent_init (main_input_filename))
 	compile_file ();
 
-      finalize ();
+      finalize (no_backend);
     }
 
   /* Stop timing and print the times.  */
-- 
Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist      Red Hat Brazil Compiler Engineer

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