OSDN Git Service

Backported from mainline
[pf3gnuchains/gcc-fork.git] / gcc / ipa-inline-transform.c
index 2609e42..ce1bc6e 100644 (file)
@@ -95,9 +95,7 @@ can_remove_node_now_p_1 (struct cgraph_node *node)
             those only after all devirtualizable virtual calls are processed.
             Lacking may edges in callgraph we just preserve them post
             inlining.  */
-         && (!DECL_VIRTUAL_P (node->decl)
-             || (!DECL_COMDAT (node->decl)
-                 && !DECL_EXTERNAL (node->decl)))
+         && !DECL_VIRTUAL_P (node->decl)
          /* During early inlining some unanalyzed cgraph nodes might be in the
             callgraph and they might reffer the function in question.  */
          && !cgraph_new_nodes);
@@ -248,6 +246,8 @@ inline_call (struct cgraph_edge *e, bool update_original,
     *overall_size += new_size - old_size;
   ncalls_inlined++;
 
+  /* This must happen after inline_merge_summary that rely on jump
+     functions of callee to not be updated.  */
   if (optimize)
     return ipa_propagate_indirect_call_infos (curr, new_edges);
   else
@@ -322,7 +322,7 @@ save_inline_function_body (struct cgraph_node *node)
 
   /* Copy the OLD_VERSION_NODE function tree to the new version.  */
   tree_function_versioning (node->decl, first_clone->decl, NULL, true, NULL,
-                           NULL, NULL);
+                           false, NULL, NULL);
 
   /* The function will be short lived and removed after we inline all the clones,
      but make it internal so we won't confuse ourself.  */
@@ -367,11 +367,13 @@ inline_transform (struct cgraph_node *node)
     todo = optimize_inline_calls (current_function_decl);
   timevar_pop (TV_INTEGRATION);
 
+  cfun->always_inline_functions_inlined = true;
+  cfun->after_inlining = true;
+  todo |= execute_fixup_cfg ();
+
   if (!(todo & TODO_update_ssa_any))
     /* Redirecting edges might lead to a need for vops to be recomputed.  */
     todo |= TODO_update_ssa_only_virtuals;
 
-  cfun->always_inline_functions_inlined = true;
-  cfun->after_inlining = true;
-  return todo | execute_fixup_cfg ();
+  return todo;
 }