]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/46188 (-fipa-cp removes destructor call)
authorRichard Guenther <rguenther@suse.de>
Tue, 19 Apr 2011 08:59:45 +0000 (08:59 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 19 Apr 2011 08:59:45 +0000 (08:59 +0000)
2011-04-19  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/46188
Backported from 4.6 branch
2010-05-26  Jan Hubicka  <jh@suse.cz>

* cgraphunit.c (clone_of_p): Remove.
(verify_cgraph_node): Do not verify clones.
(cgraph_materialize_all_clones): Do no redirection here.
* ipa-inline.c (inline_transform): Do redirection here.

From-SVN: r172698

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

index ed43f1b5c0086f64b98752ab4fc1661661e26193..9bcbfcb8bc03f1b3b636e0af9ac835fe0bd07d35 100644 (file)
@@ -1,3 +1,14 @@
+2011-04-19  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/46188
+       Backported from 4.6 branch
+       2010-05-26  Jan Hubicka  <jh@suse.cz>
+
+       * cgraphunit.c (clone_of_p): Remove.
+       (verify_cgraph_node): Do not verify clones.
+       (cgraph_materialize_all_clones): Do no redirection here.
+       * ipa-inline.c (inline_transform): Do redirection here.
+
 2011-04-18  Eric Botcazou  <ebotcazou@adacore.com>
 
        * dwarf2out.c (is_redundant_typedef): Add 'inline' to prototype.
index 0bea59b52214f1d100214b8e2deb574da925a002..75c23a823d69836684a2d7cd476789a0d77314d8 100644 (file)
@@ -553,15 +553,6 @@ cgraph_mark_if_needed (tree decl)
     cgraph_mark_needed_node (node);
 }
 
-/* Return TRUE if NODE2 is equivalent to NODE or its clone.  */
-static bool
-clone_of_p (struct cgraph_node *node, struct cgraph_node *node2)
-{
-  while (node != node2 && node2)
-    node2 = node2->clone_of;
-  return node2 != NULL;
-}
-
 /* Verify cgraph nodes of given cgraph node.  */
 void
 verify_cgraph_node (struct cgraph_node *node)
@@ -777,16 +768,6 @@ verify_cgraph_node (struct cgraph_node *node)
                            debug_tree (e->callee->decl);
                            error_found = true;
                          }
-                       else if (!node->global.inlined_to
-                                && !e->callee->global.inlined_to
-                                && !clone_of_p (cgraph_node (decl), e->callee))
-                         {
-                           error ("edge points to wrong declaration:");
-                           debug_tree (e->callee->decl);
-                           fprintf (stderr," Instead of:");
-                           debug_tree (decl);
-                           error_found = true;
-                         }
                        e->aux = (void *)1;
                      }
                    else
@@ -2396,31 +2377,8 @@ cgraph_materialize_all_clones (void)
   for (node = cgraph_nodes; node; node = node->next)
     if (!node->analyzed && node->callees)
       cgraph_node_remove_callees (node);
-  if (cgraph_dump_file)
-    fprintf (cgraph_dump_file, "Updating call sites\n");
-  for (node = cgraph_nodes; node; node = node->next)
-    if (node->analyzed && !node->clone_of
-       && gimple_has_body_p (node->decl))
-      {
-        struct cgraph_edge *e;
-
-       current_function_decl = node->decl;
-        push_cfun (DECL_STRUCT_FUNCTION (node->decl));
-       for (e = node->callees; e; e = e->next_callee)
-         cgraph_redirect_edge_call_stmt_to_callee (e);
-       pop_cfun ();
-       current_function_decl = NULL;
-#ifdef ENABLE_CHECKING
-        verify_cgraph_node (node);
-#endif
-      }
   if (cgraph_dump_file)
     fprintf (cgraph_dump_file, "Materialization Call site updates done.\n");
-  /* All changes to parameters have been performed.  In order not to
-     incorrectly repeat them, we simply dispose of the bitmaps that drive the
-     changes. */
-  for (node = cgraph_nodes; node; node = node->next)
-    node->clone.combined_args_to_skip = NULL;
 #ifdef ENABLE_CHECKING
   verify_cgraph ();
 #endif
index 8b2e3849a2a9f0c501263ca37139cafac5d6c5e8..41a3d1b784ece3660ce1c733ce8924b0486c1270 100644 (file)
@@ -2092,6 +2092,7 @@ inline_transform (struct cgraph_node *node)
 {
   unsigned int todo = 0;
   struct cgraph_edge *e;
+  bool inline_p = false;
 
   /* FIXME: Currently the passmanager is adding inline transform more than once to some
      clones.  This needs revisiting after WPA cleanups.  */
@@ -2104,10 +2105,13 @@ inline_transform (struct cgraph_node *node)
     save_inline_function_body (node);
 
   for (e = node->callees; e; e = e->next_callee)
-    if (!e->inline_failed || warn_inline)
-      break;
+    {
+      cgraph_redirect_edge_call_stmt_to_callee (e);
+      if (!e->inline_failed || warn_inline)
+       inline_p = true;
+    }
 
-  if (e)
+  if (inline_p)
     {
       timevar_push (TV_INTEGRATION);
       todo = optimize_inline_calls (current_function_decl);