From: jamborm Date: Thu, 18 Mar 2010 20:07:13 +0000 (+0000) Subject: 2010-03-18 Martin Jambor X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=commitdiff_plain;h=b1f1685f43b6ae313714ac79adc1738b4cdbde1b;hp=f54dca8161bcceea6a3704b56cc079e250dc3977 2010-03-18 Martin Jambor 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 53ae36f60d4..d3ed14f9256 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,20 @@ +2010-03-18 Martin Jambor + + 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 * config/i386/libgcc-glibc.ver: Make GCC_4.5.0 inherit GCC_4.4.0. diff --git a/gcc/cgraph.h b/gcc/cgraph.h index b0923019c71..32942c65015 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -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); diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index c811d497afd..b91e218f3a4 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -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 diff --git a/gcc/ipa.c b/gcc/ipa.c index c8b0d7b385d..01beca7df11 100644 --- 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) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ba7b96337f4..0d78bf83627 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-03-18 Martin Jambor + + PR middle-end/42450 + * g++.dg/torture/pr42450.C: New test. + 2010-03-18 Michael Matz PR middle-end/43419