re PR tree-optimization/40556 (ICE in IPA-CP with recursion)
authorJan Hubicka <jh@suse.cz>
Thu, 22 Oct 2009 13:31:48 +0000 (15:31 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Thu, 22 Oct 2009 13:31:48 +0000 (13:31 +0000)
* ipa-cp.c (ipcp_read_summary): Remove now invalid FIXME and
flag_ltrans check.
* ipa-inline.c (cgraph_mark_inline_edge,
cgraph_decide_inlining_of_small_function,
cgraph_decide_inlining, inline_read_summary): Disable indirect inlining
for WPA for time being.

PR tree-optimize/40556
* ipa-inline.c (cgraph_early_inlining): Fix iterations condition.

Fix PR number for earlier patch to:
PR lto/41730

From-SVN: r153456

gcc/ChangeLog
gcc/ipa-cp.c
gcc/ipa-inline.c

index 5d91f87..d935854 100644 (file)
@@ -1,3 +1,15 @@
+2009-10-22  Jan Hubicka  <jh@suse.cz>
+
+       * ipa-cp.c (ipcp_read_summary): Remove now invalid FIXME and
+       flag_ltrans check.
+       * ipa-inline.c (cgraph_mark_inline_edge,
+       cgraph_decide_inlining_of_small_function,
+       cgraph_decide_inlining, inline_read_summary): Disable indirect inlining
+       for WPA for time being.
+
+       PR tree-optimize/40556                                                                                                                                         
+       * ipa-inline.c (cgraph_early_inlining): Fix iterations condition.
+
 2009-10-22  Richard Guenther  <rguenther@suse.de>
 
        * lto-streamer.h (lto_symtab_clear_resolution): Remove.
@@ -5,7 +17,7 @@
 
 2009-10-22  Jan Hubicka  <jh@suse.cz>
 
-       PR tree-optimize/40556
+       PR lto/41730
        * ipa-reference.c (has_proper_scope_for_analysis): Add fixme about
        global vars.
        (check_call): Handle only indirect calls.
index 4166e78..79ff16e 100644 (file)
@@ -1302,13 +1302,7 @@ ipcp_read_summary (void)
 static bool
 cgraph_gate_cp (void)
 {
-  /* FIXME lto.  IPA-CP does not tolerate running when the inlining decisions
-     have not been applied.  This happens when WPA modifies the callgraph.
-     Since those decisions are not applied until after all the IPA passes
-     have been run in LTRANS, this means that IPA passes may see partially
-     modified callgraphs.  The solution to this is to apply WPA decisions
-     early during LTRANS.  */
-  return flag_ipa_cp && !flag_ltrans;
+  return flag_ipa_cp;
 }
 
 struct ipa_opt_pass_d pass_ipa_cp =
index 9e1bc9f..81c3379 100644 (file)
@@ -310,7 +310,7 @@ cgraph_mark_inline_edge (struct cgraph_edge *e, bool update_original,
     overall_size -= orig_size;
   ncalls_inlined++;
 
-  if (flag_indirect_inlining)
+  if (flag_indirect_inlining && !flag_wpa)
     return ipa_propagate_indirect_call_infos (curr, new_edges);
   else
     return false;
@@ -876,7 +876,7 @@ cgraph_decide_inlining_of_small_functions (void)
   int min_size, max_size;
   VEC (cgraph_edge_p, heap) *new_indirect_edges = NULL;
 
-  if (flag_indirect_inlining)
+  if (flag_indirect_inlining && !flag_wpa)
     new_indirect_edges = VEC_alloc (cgraph_edge_p, heap, 8);
 
   if (dump_file)
@@ -1023,10 +1023,10 @@ cgraph_decide_inlining_of_small_functions (void)
          if (where->global.inlined_to)
            where = where->global.inlined_to;
          if (!cgraph_decide_recursive_inlining (where,
-                                                flag_indirect_inlining
+                                                flag_indirect_inlining && !flag_wpa
                                                 ? &new_indirect_edges : NULL))
            continue;
-         if (flag_indirect_inlining)
+         if (flag_indirect_inlining && !flag_wpa)
            add_new_edges_to_heap (heap, new_indirect_edges);
           update_callee_keys (heap, where, updated_nodes);
        }
@@ -1045,7 +1045,7 @@ cgraph_decide_inlining_of_small_functions (void)
            }
          callee = edge->callee;
          cgraph_mark_inline_edge (edge, true, &new_indirect_edges);
-         if (flag_indirect_inlining)
+         if (flag_indirect_inlining && !flag_wpa)
            add_new_edges_to_heap (heap, new_indirect_edges);
 
          update_callee_keys (heap, callee, updated_nodes);
@@ -1114,7 +1114,7 @@ cgraph_decide_inlining (void)
   int initial_size = 0;
 
   cgraph_remove_function_insertion_hook (function_insertion_hook_holder);
-  if (in_lto_p && flag_indirect_inlining)
+  if (in_lto_p && flag_indirect_inlining && !flag_wpa)
     ipa_update_after_lto_read ();
 
   max_count = 0;
@@ -1268,7 +1268,7 @@ cgraph_decide_inlining (void)
     }
 
   /* Free ipa-prop structures if they are no longer needed.  */
-  if (flag_indirect_inlining)
+  if (flag_indirect_inlining && !flag_wpa)
     free_all_ipa_structures_after_iinln ();
 
   if (dump_file)
@@ -1589,10 +1589,10 @@ cgraph_early_inlining (void)
 
   if (sorrycount || errorcount)
     return 0;
-  while (cgraph_decide_inlining_incrementally (node,
-                                              iterations
-                                              ? INLINE_SIZE_NORECURSIVE : INLINE_SIZE, 0)
-        && iterations < PARAM_VALUE (PARAM_EARLY_INLINER_MAX_ITERATIONS))
+  while (iterations < PARAM_VALUE (PARAM_EARLY_INLINER_MAX_ITERATIONS)
+         && cgraph_decide_inlining_incrementally (node,
+                                                 iterations
+                                                 ? INLINE_SIZE_NORECURSIVE : INLINE_SIZE, 0))
     {
       timevar_push (TV_INTEGRATION);
       todo |= optimize_inline_calls (current_function_decl);
@@ -1975,7 +1975,7 @@ inline_transform (struct cgraph_node *node)
 static void 
 inline_read_summary (void)
 {
-  if (flag_indirect_inlining)
+  if (flag_indirect_inlining && !flag_wpa)
     {
       ipa_register_cgraph_hooks ();
       if (!flag_ipa_cp)