This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[tcb] Stop timevar timer right after executing a pass
- From: Diego Novillo <dnovillo at redhat dot com>
- To: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 14 Oct 2004 23:48:18 -0400
- Subject: [tcb] Stop timevar timer right after executing a pass
- Organization: Red Hat Canada
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);