aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2009-05-09 18:31:32 +0000
committerJan Hubicka <jh@suse.cz>2009-05-09 18:31:32 +0000
commitb203de27acfe4497594c12129c3dcfe78ecabcd8 (patch)
tree3a638acc7b1cb01fa6580f3777916be5c4530c7b
parent231ff3bc408254f41ca7313160a1b4db125ae0f0 (diff)
PR bootstrap/40082
* ipa.c (update_inlined_to_pointer): New function. (cgraph_remove_unreachable_nodes): Use it. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@147319 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/ipa.c18
2 files changed, 23 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 26f2a689a2a..6de79afa97a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
2009-05-09 Jan Hubicka <jh@suse.cz>
+ PR bootstrap/40082
+ * ipa.c (update_inlined_to_pointer): New function.
+ (cgraph_remove_unreachable_nodes): Use it.
+
+2009-05-09 Jan Hubicka <jh@suse.cz>
+
* tree-eh.c (struct leh_state): Remove prev_try.
(lower_try_finally, lower_catch, lower_eh_filter, lower_cleanup): Do
not track prev_try.
diff --git a/gcc/ipa.c b/gcc/ipa.c
index 686ca9e1348..b51c219d1fb 100644
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -92,6 +92,21 @@ cgraph_postorder (struct cgraph_node **order)
return order_pos;
}
+/* Look for all functions inlined to NODE and update their inlined_to pointers
+ to INLINED_TO. */
+
+static void
+update_inlined_to_pointer (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_pointer (e->callee, inlined_to);
+ }
+}
+
/* Perform reachability analysis and reclaim all unreachable nodes.
If BEFORE_INLINING_P is true this function is called before inlining
decisions has been made. If BEFORE_INLINING_P is false this function also
@@ -214,7 +229,8 @@ cgraph_remove_unreachable_nodes (bool before_inlining_p, FILE *file)
&& !node->callers)
{
gcc_assert (node->clones);
- node->global.inlined_to = false;
+ node->global.inlined_to = NULL;
+ update_inlined_to_pointer (node, node);
}
node->aux = NULL;
}