summaryrefslogtreecommitdiff
path: root/gcc/lto
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/lto')
-rw-r--r--gcc/lto/ChangeLog5
-rw-r--r--gcc/lto/lto.c49
2 files changed, 54 insertions, 0 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index 938d32cb2ef..a53a8c04e79 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,8 @@
+2009-10-22 Jan Hubicka <jh@suse.cz>
+
+ * lto.c (lto_fixup_jump_functions): New function.
+ (lto_fixup_decls): Use it.
+
2009-10-16 Richard Guenther <rguenther@suse.de>
PR lto/41715
diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c
index 2b674c176ac..a8ad9e369b9 100644
--- a/gcc/lto/lto.c
+++ b/gcc/lto/lto.c
@@ -1652,6 +1652,53 @@ free_decl (const void *p, void *data ATTRIBUTE_UNUSED)
return true;
}
+/* Fixup pointers in jump functions.
+ TODO: We need some generic solution that will allow tree pointers in
+ function summaries. */
+static void
+lto_fixup_jump_functions (lto_fixup_data_t * data)
+{
+ struct cgraph_node *node;
+ struct cgraph_edge *cs;
+
+ for (node = cgraph_nodes; node; node = node->next)
+ {
+ if (!node->analyzed)
+ continue;
+ for (cs = node->callees; cs; cs = cs->next_callee)
+ {
+ int i;
+ struct ipa_edge_args *args = IPA_EDGE_REF (cs);
+ for (i = 0; i < ipa_get_cs_argument_count (args); i++)
+ {
+ struct ipa_jump_func *jf = ipa_get_ith_jump_func (args, i);
+ switch (jf->type)
+ {
+ case IPA_JF_UNKNOWN:
+ break;
+ case IPA_JF_CONST:
+ walk_tree (&jf->value.constant, lto_fixup_tree, data, NULL);
+ break;
+ case IPA_JF_PASS_THROUGH:
+ walk_tree (&jf->value.pass_through.operand, lto_fixup_tree,
+ data, NULL);
+ break;
+ case IPA_JF_ANCESTOR:
+ walk_tree (&jf->value.ancestor.type, lto_fixup_tree, data,
+ NULL);
+ break;
+ case IPA_JF_CONST_MEMBER_PTR:
+ walk_tree (&jf->value.member_cst.pfn, lto_fixup_tree, data,
+ NULL);
+ walk_tree (&jf->value.member_cst.delta, lto_fixup_tree,
+ data, NULL);
+ break;
+ }
+ }
+ }
+ }
+}
+
/* Fix the decls from all FILES. Replaces each decl with the corresponding
prevailing one. */
@@ -1682,6 +1729,8 @@ lto_fixup_decls (struct lto_file_decl_data **files)
if (decl != saved_decl)
VEC_replace (tree, lto_global_var_decls, i, decl);
}
+ if (ipa_edge_args_vector)
+ lto_fixup_jump_functions (&data);
pointer_set_traverse (free_list, free_decl, NULL);
pointer_set_destroy (free_list);