summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2004-09-17 21:04:56 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2004-09-17 21:04:56 +0000
commit617792a15f24a24d312d1f1ead1e23aa69ff5c5e (patch)
treebf5ae808d2f1483e6acc4079c57fd6fd42969fd4
parent913910e01dc0ce34facaab0f3d4c260703418a4f (diff)
downloadgcc-617792a15f24a24d312d1f1ead1e23aa69ff5c5e.tar.gz
PR tree-optimization/17509
* tree-optimize.c (update_inlined_to_pointers): New function. (tree_rest_of_compilation): Use it. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@87669 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/tree-optimize.c24
2 files changed, 29 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9b11e42c71c..ff1725f5a97 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2004-09-17 Jan Hubicka <jh@suse.cz>
+
+ PR tree-optimization/17509
+ * tree-optimize.c (update_inlined_to_pointers): New function.
+ (tree_rest_of_compilation): Use it.
+
2004-09-17 Devang Patel <dpatel@apple.com>
* dbxout.c (get_lang_number): New.
diff --git a/gcc/tree-optimize.c b/gcc/tree-optimize.c
index b9a2fa55ece..fdb7e766a25 100644
--- a/gcc/tree-optimize.c
+++ b/gcc/tree-optimize.c
@@ -539,6 +539,24 @@ execute_pass_list (struct tree_opt_pass *pass)
}
while (pass);
}
+
+
+/* update recursivly all inlined_to pointers of functions
+ inlined into NODE to INLINED_TO. */
+static void
+update_inlined_to_pointers (struct cgraph_node *node,
+ struct cgraph_node *inlined_to)
+{
+ struct cgraph_edge *e;
+ for (e = node->callees; e; e = e->next_callee)
+ {
+ if (e->callee->global.inlined_to)
+ {
+ e->callee->global.inlined_to = inlined_to;
+ update_inlined_to_pointers (e->callee, node);
+ }
+ }
+}
/* For functions-as-trees languages, this performs all optimization and
@@ -630,6 +648,7 @@ tree_rest_of_compilation (tree fndecl, bool nested_p)
if (!flag_unit_at_a_time)
{
struct cgraph_edge *e;
+ verify_cgraph ();
while (node->callees)
cgraph_remove_edge (node->callees);
node->callees = saved_node->callees;
@@ -637,7 +656,10 @@ tree_rest_of_compilation (tree fndecl, bool nested_p)
for (e = node->callees; e; e = e->next_callee)
{
if (e->callee->global.inlined_to)
- e->callee->global.inlined_to = node;
+ {
+ e->callee->global.inlined_to = node;
+ update_inlined_to_pointers (e->callee, node);
+ }
e->caller = node;
}
cgraph_remove_node (saved_node);