re PR ipa/91062 (gcc.dg/ipa/ipa-pta-1.c dump contains garbage when gcc was configured...
authorRichard Biener <rguenther@suse.de>
Thu, 4 Jul 2019 13:56:12 +0000 (13:56 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 4 Jul 2019 13:56:12 +0000 (13:56 +0000)
2019-07-04  Richard Biener  <rguenther@suse.de>

PR ipa/91062
* tree-pass.h (execute_all_ipa_transforms): Add a flag
parameter whether to disable GC collection.
* passes.c (execute_one_ipa_transform_pass): Likewise, and
honor it.
(execute_all_ipa_transforms): Likewise and pass it down.
* cgraph.c (cgraph_node::get_body): Do not invoke garbage
collection from applying IPA transforms.
* cgraphunit.c (cgraph_node::expand): Allow garbage collection
from applying IPA transforms.

From-SVN: r273083

gcc/ChangeLog
gcc/cgraph.c
gcc/cgraphunit.c
gcc/passes.c
gcc/tree-pass.h

index 591e297..19ab956 100644 (file)
@@ -1,5 +1,18 @@
 2019-07-04  Richard Biener  <rguenther@suse.de>
 
+       PR ipa/91062
+       * tree-pass.h (execute_all_ipa_transforms): Add a flag
+       parameter whether to disable GC collection.
+       * passes.c (execute_one_ipa_transform_pass): Likewise, and
+       honor it.
+       (execute_all_ipa_transforms): Likewise and pass it down.
+       * cgraph.c (cgraph_node::get_body): Do not invoke garbage
+       collection from applying IPA transforms.
+       * cgraphunit.c (cgraph_node::expand): Allow garbage collection
+       from applying IPA transforms.
+
+2019-07-04  Richard Biener  <rguenther@suse.de>
+
        PR tree-optimization/90911
        * tree-vectorizer.h (_loop_vec_info::scalar_loop_scaling): New field.
        (LOOP_VINFO_SCALAR_LOOP_SCALING): new.
index d161db9..a7e3bcf 100644 (file)
@@ -3618,7 +3618,7 @@ cgraph_node::get_body (void)
       set_dump_file (NULL);
 
       push_cfun (DECL_STRUCT_FUNCTION (decl));
-      execute_all_ipa_transforms ();
+      execute_all_ipa_transforms (true);
       cgraph_edge::rebuild_edges ();
       free_dominance_info (CDI_DOMINATORS);
       free_dominance_info (CDI_POST_DOMINATORS);
index f4d6688..5999b9e 100644 (file)
@@ -2184,7 +2184,7 @@ cgraph_node::expand (void)
 
   bitmap_obstack_initialize (&reg_obstack); /* FIXME, only at RTL generation*/
 
-  execute_all_ipa_transforms ();
+  execute_all_ipa_transforms (false);
 
   /* Perform all tree transforms and optimizations.  */
 
index c6331cb..bd56004 100644 (file)
@@ -2182,7 +2182,7 @@ execute_ipa_summary_passes (ipa_opt_pass_d *ipa_pass)
 
 static void
 execute_one_ipa_transform_pass (struct cgraph_node *node,
-                               ipa_opt_pass_d *ipa_pass)
+                               ipa_opt_pass_d *ipa_pass, bool do_not_collect)
 {
   opt_pass *pass = ipa_pass;
   unsigned int todo_after = 0;
@@ -2228,14 +2228,14 @@ execute_one_ipa_transform_pass (struct cgraph_node *node,
   redirect_edge_var_map_empty ();
 
   /* Signal this is a suitable GC collection point.  */
-  if (!(todo_after & TODO_do_not_ggc_collect))
+  if (!do_not_collect && !(todo_after & TODO_do_not_ggc_collect))
     ggc_collect ();
 }
 
 /* For the current function, execute all ipa transforms. */
 
 void
-execute_all_ipa_transforms (void)
+execute_all_ipa_transforms (bool do_not_collect)
 {
   struct cgraph_node *node;
   if (!cfun)
@@ -2247,7 +2247,8 @@ execute_all_ipa_transforms (void)
       unsigned int i;
 
       for (i = 0; i < node->ipa_transforms_to_apply.length (); i++)
-       execute_one_ipa_transform_pass (node, node->ipa_transforms_to_apply[i]);
+       execute_one_ipa_transform_pass (node, node->ipa_transforms_to_apply[i],
+                                       do_not_collect);
       node->ipa_transforms_to_apply.release ();
     }
 }
index 3a0b380..b27dbdd 100644 (file)
@@ -632,7 +632,7 @@ extern bool execute_one_pass (opt_pass *);
 extern void execute_pass_list (function *, opt_pass *);
 extern void execute_ipa_pass_list (opt_pass *);
 extern void execute_ipa_summary_passes (ipa_opt_pass_d *);
-extern void execute_all_ipa_transforms (void);
+extern void execute_all_ipa_transforms (bool);
 extern void execute_all_ipa_stmt_fixups (struct cgraph_node *, gimple **);
 extern bool pass_init_dump_file (opt_pass *);
 extern void pass_fini_dump_file (opt_pass *);