This adds a GC collection point after each pass instead just after
those with TODO_ggc_collect in their todo.  The patch will possibly
slow-down gcac checking a bit (80 passes have TODO_ggc_collect,
I didn't try to enumerate those that do not, but a grep shows we
may have up to 212 passes.  OTOH gcac checking will now "properly"
verify that all pass boundaries are suitable for collection.

A complete patch will remove TODO_ggc_collect and all its uses
as well.

The patch should result in lower peak memory consumption for
some of the odd testcases that we worked on.

Bootstrap & regtest scheduled on x86_64-unknown-linux-gnu.

Richard.

2013-03-19  Richard Biener  <rguent...@suse.de>

        * passes.c (execute_todo): Do not call ggc_collect conditional here.
        (execute_one_ipa_transform_pass): But unconditionally here.
        (execute_one_pass): And here.

Index: trunk/gcc/passes.c
===================================================================
*** trunk.orig/gcc/passes.c     2013-03-19 12:25:46.000000000 +0100
--- trunk/gcc/passes.c  2013-03-19 13:25:49.757259321 +0100
*************** execute_todo (unsigned int flags)
*** 2016,2024 ****
        fflush (dump_file);
      }
  
-   if (flags & TODO_ggc_collect)
-     ggc_collect ();
- 
    /* Now that the dumping has been done, we can get rid of the optional
       df problems.  */
    if (flags & TODO_df_finish)
--- 2016,2021 ----
*************** execute_one_ipa_transform_pass (struct c
*** 2190,2195 ****
--- 2187,2195 ----
    pass_fini_dump_file (pass);
  
    current_pass = NULL;
+ 
+   /* Signal this is a suitable GC collection point.  */
+   ggc_collect ();
  }
  
  /* For the current function, execute all ipa transforms. */
*************** execute_one_pass (struct opt_pass *pass)
*** 2367,2372 ****
--- 2367,2375 ----
  
    current_pass = NULL;
  
+   /* Signal this is a suitable GC collection point.  */
+   ggc_collect ();
+ 
    return true;
  }
  

Reply via email to