diff options
author | Jan Hubicka <jh@suse.cz> | 2004-09-08 11:28:06 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2004-09-08 09:28:06 +0000 |
commit | 89480522221ee99f08da1abd7197b5b7c978d5c0 (patch) | |
tree | 29b2c1082d2d4dda08ca1f0a6b2e0aa510db37c2 | |
parent | 323e3709b9ccdd514ac4ce2e2ba7e934984591b1 (diff) | |
download | gcc-89480522221ee99f08da1abd7197b5b7c978d5c0.zip gcc-89480522221ee99f08da1abd7197b5b7c978d5c0.tar.gz gcc-89480522221ee99f08da1abd7197b5b7c978d5c0.tar.bz2 |
cgraph.c (cgraph_remove_node): Free DECL_INITIAL field of node.
* cgraph.c (cgraph_remove_node): Free DECL_INITIAL field of node.
* cgraphunit.c (verify_cgraph): Don't verify on syntax errors.
(cgraph_expand_function): Remove stale cgraph edges of currently
compiled function; fix non-unit-at-a-time code copying function
node for later reuse.
From-SVN: r87181
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/cgraph.c | 1 | ||||
-rw-r--r-- | gcc/cgraphunit.c | 10 | ||||
-rw-r--r-- | gcc/tree-optimize.c | 13 |
4 files changed, 28 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 87ce651..e1a2ac1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2004-09-08 Jan Hubicka <jh@suse.cz> + + * cgraph.c (cgraph_remove_node): Free DECL_INITIAL field of node. + * cgraphunit.c (verify_cgraph): Don't verify on syntax errors. + (cgraph_expand_function): Remove stale cgraph edges of currently + compiled function; fix non-unit-at-a-time code copying function + node for later reuse. + 2004-09-08 Nathan Sidwell <nathan@codesourcery.com> * vec.c (vec_p_reserve, vec_o_reserve): Rename to ... diff --git a/gcc/cgraph.c b/gcc/cgraph.c index a2cb174..6c93ac5 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -354,6 +354,7 @@ cgraph_remove_node (struct cgraph_node *node) { DECL_SAVED_TREE (node->decl) = NULL; DECL_STRUCT_FUNCTION (node->decl) = NULL; + DECL_INITIAL (node->decl) = error_mark_node; } } cgraph_n_nodes--; diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index a045457..81df309 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -610,6 +610,9 @@ verify_cgraph (void) { struct cgraph_node *node; + if (sorrycount || errorcount) + return; + for (node = cgraph_nodes; node; node = node->next) verify_cgraph_node (node); } @@ -800,12 +803,15 @@ cgraph_expand_function (struct cgraph_node *node) gcc_assert (TREE_ASM_WRITTEN (node->decl)); current_function_decl = NULL; - if (DECL_SAVED_TREE (node->decl) - && !cgraph_preserve_function_body_p (node->decl)) + if (!cgraph_preserve_function_body_p (node->decl)) { DECL_SAVED_TREE (node->decl) = NULL; DECL_STRUCT_FUNCTION (node->decl) = NULL; DECL_INITIAL (node->decl) = error_mark_node; + /* Elliminate all call edges. This is important so the call_expr no longer + points to the dead function body. */ + while (node->callees) + cgraph_remove_edge (node->callees); } } diff --git a/gcc/tree-optimize.c b/gcc/tree-optimize.c index 701b104..d081fe0 100644 --- a/gcc/tree-optimize.c +++ b/gcc/tree-optimize.c @@ -604,6 +604,11 @@ tree_rest_of_compilation (tree fndecl, bool nested_p) } } + /* We are not going to maintain the cgraph edges up to date. + Kill it so it won't confuse us. */ + while (node->callees) + cgraph_remove_edge (node->callees); + if (!vars_to_rename) vars_to_rename = BITMAP_XMALLOC (); @@ -632,8 +637,12 @@ tree_rest_of_compilation (tree fndecl, bool nested_p) cgraph_remove_edge (node->callees); node->callees = saved_node->callees; saved_node->callees = NULL; - for (e = saved_node->callees; e; e = e->next_callee) - e->caller = node; + for (e = node->callees; e; e = e->next_callee) + { + if (e->callee->global.inlined_to) + e->callee->global.inlined_to = node; + e->caller = node; + } cgraph_remove_node (saved_node); } } |