OSDN Git Service

2010-03-18 Martin Jambor <mjambor@suse.cz>
authorjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 18 Mar 2010 20:07:13 +0000 (20:07 +0000)
committerMasaki Muranaka <monaka@monami-software.com>
Sun, 23 May 2010 05:13:19 +0000 (14:13 +0900)
PR middle-end/42450
* cgraph.h (cgraph_redirect_edge_call_stmt_to_callee): Declare.
* cgraphunit.c (cgraph_materialize_all_clones): Update calls in
all non-clones.  Moved call redirection...
(cgraph_redirect_edge_call_stmt_to_callee): ...to this new
function.
(cgraph_materialize_all_clones): Dispose of all
combined_args_to_skip bitmaps.
(verify_cgraph_node): Do not check for edges pointing to wrong
nodes in inline clones.
* tree-inline.c (copy_bb): Call
cgraph_redirect_edge_call_stmt_to_callee.
* ipa.c (cgraph_remove_unreachable_nodes): Call
cgraph_node_remove_callees even when there are used clones.

* testsuite/g++.dg/torture/pr42450.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157546 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/cgraph.h
gcc/cgraphunit.c
gcc/ipa.c
gcc/testsuite/ChangeLog

index 53ae36f..d3ed14f 100644 (file)
@@ -1,3 +1,20 @@
+2010-03-18  Martin Jambor  <mjambor@suse.cz>
+
+       PR middle-end/42450
+       * cgraph.h (cgraph_redirect_edge_call_stmt_to_callee): Declare.
+       * cgraphunit.c (cgraph_materialize_all_clones): Update calls in
+       all non-clones.  Moved call redirection...
+       (cgraph_redirect_edge_call_stmt_to_callee): ...to this new
+       function.
+       (cgraph_materialize_all_clones): Dispose of all
+       combined_args_to_skip bitmaps.
+       (verify_cgraph_node): Do not check for edges pointing to wrong
+       nodes in inline clones.
+       * tree-inline.c (copy_bb): Call
+       cgraph_redirect_edge_call_stmt_to_callee.
+       * ipa.c (cgraph_remove_unreachable_nodes): Call
+       cgraph_node_remove_callees even when there are used clones.
+
 2010-03-18  H.J. Lu  <hongjiu.lu@intel.com>
 
        * config/i386/libgcc-glibc.ver: Make GCC_4.5.0 inherit GCC_4.4.0.
index b092301..32942c6 100644 (file)
@@ -636,7 +636,6 @@ struct cgraph_2node_hook_list *cgraph_add_node_duplication_hook (cgraph_2node_ho
 void cgraph_remove_node_duplication_hook (struct cgraph_2node_hook_list *);
 void cgraph_materialize_all_clones (void);
 gimple cgraph_redirect_edge_call_stmt_to_callee (struct cgraph_edge *);
-bool cgraph_propagate_frequency (struct cgraph_node *node);
 /* In cgraphbuild.c  */
 unsigned int rebuild_cgraph_edges (void);
 void cgraph_rebuild_references (void);
index c811d49..b91e218 100644 (file)
@@ -812,7 +812,9 @@ verify_cgraph_node (struct cgraph_node *node)
                                error_found = true;
                              }
                          }
-                       else if (decl)
+                       else if (!node->global.inlined_to
+                                && !e->callee->global.inlined_to
+                                && !clone_of_p (cgraph_node (decl), e->callee))
                          {
                            error ("an indirect edge with unknown callee "
                                   "corresponding to a call_stmt with "
@@ -2342,7 +2344,6 @@ cgraph_redirect_edge_call_stmt_to_callee (struct cgraph_edge *e)
 
   gsi = gsi_for_stmt (e->call_stmt);
   gsi_replace (&gsi, new_stmt, true);
-  update_stmt (new_stmt);
 
   /* Update EH information too, just in case.  */
   maybe_clean_or_replace_eh_stmt (e->call_stmt, new_stmt);
@@ -2445,7 +2446,6 @@ cgraph_materialize_all_clones (void)
         push_cfun (DECL_STRUCT_FUNCTION (node->decl));
        for (e = node->callees; e; e = e->next_callee)
          cgraph_redirect_edge_call_stmt_to_callee (e);
-       gcc_assert (!need_ssa_update_p (cfun));
        pop_cfun ();
        current_function_decl = NULL;
 #ifdef ENABLE_CHECKING
index c8b0d7b..01beca7 100644 (file)
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -388,10 +388,7 @@ cgraph_remove_unreachable_nodes (bool before_inlining_p, FILE *file)
                      node->analyzed = false;
                      node->local.inlinable = false;
                    }
-                 else
-                   gcc_assert (!clone->in_other_partition);
                  cgraph_node_remove_callees (node);
-                 ipa_remove_all_references (&node->ref_list);
                  if (node->prev_sibling_clone)
                    node->prev_sibling_clone->next_sibling_clone = node->next_sibling_clone;
                  else if (node->clone_of)
index ba7b963..0d78bf8 100644 (file)
@@ -1,3 +1,8 @@
+2010-03-18  Martin Jambor  <mjambor@suse.cz>
+
+       PR middle-end/42450
+       * g++.dg/torture/pr42450.C: New test.
+
 2010-03-18  Michael Matz  <matz@suse.de>
 
        PR middle-end/43419