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]

[tcb] Stop timevar timer right after executing a pass


The timevar timer was being stopped after executing the todo list
associated with a pass.  This means that times were being wrongly
charged.  I'll move this to mainline as well.

Bootstrapped and tested on x86, x86-64 and ppc.


Diego.


	* tree-optimize.c (execute_one_pass): Stop timer right after
	executing the pass.

Index: tree-optimize.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-optimize.c,v
retrieving revision 2.47.2.5
diff -d -c -p -r2.47.2.5 tree-optimize.c
*** tree-optimize.c	13 Oct 2004 16:04:15 -0000	2.47.2.5
--- tree-optimize.c	15 Oct 2004 00:47:38 -0000
*************** execute_one_pass (struct tree_opt_pass *
*** 510,515 ****
--- 536,545 ----
    if (pass->execute)
      pass->execute ();
  
+   /* Stop timevar.  */
+   if (pass->tv_id)
+     timevar_pop (pass->tv_id);
+ 
    if (dump_file
        && (pass->properties_provided & (PROP_cfg | PROP_rtl))
  	  == (PROP_cfg | PROP_rtl))
*************** execute_one_pass (struct tree_opt_pass *
*** 521,529 ****
    if (todo)
      execute_todo (pass->properties_provided, todo);
  
!   /* Close down timevar and dump file.  */
!   if (pass->tv_id)
!     timevar_pop (pass->tv_id);
    if (dump_file_name)
      {
        free ((char *) dump_file_name);
--- 551,557 ----
    if (todo)
      execute_todo (pass->properties_provided, todo);
  
!   /* Flush and close dump file.  */
    if (dump_file_name)
      {
        free ((char *) dump_file_name);



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