aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto-cgraph.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2010-05-12 23:32:59 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2010-05-12 21:32:59 +0000
commit5f902d766c18beade9fd700b53a83d4e57622b10 (patch)
treed7aef00d4cbf971dd328d8e3e60c9fd6278373a2 /gcc/lto-cgraph.c
parent87a0ebfd203382a034b76c3a087d310908005454 (diff)
downloadgcc-5f902d766c18beade9fd700b53a83d4e57622b10.zip
gcc-5f902d766c18beade9fd700b53a83d4e57622b10.tar.gz
gcc-5f902d766c18beade9fd700b53a83d4e57622b10.tar.bz2
cgraphbuild.c (build_cgraph_edges, [...]): Build indrect edges too.
* cgraphbuild.c (build_cgraph_edges, rebuild_cgraph_edges): Build indrect edges too. * cgraph.c (cgraph_create_indirect_edge): Take ecf_flags argument. (cgraph_clone_edge): Update. (cgraph_node_remove_callees): Remove indirect calls too. * cgraph.h (cgraph_indirect_call_info): Add ecf_flags. (cgraph_create_indirect_edge): Update prototype. * ipa-reference.c (has_proper_scope_for_analysis): Rename to is_proper_for_analysis. (add_new_function, visited_nodes, function_insertion_hook_holder, get_local_reference_vars_info, mark_address_taken, mark_address, mark_load, mark_store, check_asm_memory_clobber, check_call, scan_stmt_for_static_refs, scan_initializer_for_static_refs): Remove. (ipa_init): Do not initialize visited_nodes; function_insertion_hook_holder. (analyze_variable): Rewrite. (analyze_function): Rewrite. (copy_local_bitmap): Remove. (duplicate_node_dat): Do not duplicate local info. (generate_summary): Simplify to only walk cgraph. (write_node_summary_p, ipa_reference_write_summary, ipa_reference_read_summary): Remove. (propagate): Do not remove function insertion; generate summary. (pass_ipa_reference): NULLify summary handling fields. * lto-cgraph.c (lto_output_edge): Output ecf_flags. (input_edge): Input ecf_flags. * ipa-prop.c (ipa_note_parm_call): Expect edge to be around. (update_indirect_edges_after_inlining): Ignore edges with unknown param. From-SVN: r159343
Diffstat (limited to 'gcc/lto-cgraph.c')
-rw-r--r--gcc/lto-cgraph.c34
1 files changed, 33 insertions, 1 deletions
diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c
index df4d2446..88741f5 100644
--- a/gcc/lto-cgraph.c
+++ b/gcc/lto-cgraph.c
@@ -282,6 +282,21 @@ lto_output_edge (struct lto_simple_output_block *ob, struct cgraph_edge *edge,
bp_pack_value (bp, edge->indirect_inlining_edge, 1);
bp_pack_value (bp, edge->call_stmt_cannot_inline_p, 1);
bp_pack_value (bp, edge->can_throw_external, 1);
+ if (edge->indirect_unknown_callee)
+ {
+ int flags = edge->indirect_info->ecf_flags;
+ bp_pack_value (bp, (flags & ECF_CONST) != 0, 1);
+ bp_pack_value (bp, (flags & ECF_PURE) != 0, 1);
+ bp_pack_value (bp, (flags & ECF_NORETURN) != 0, 1);
+ bp_pack_value (bp, (flags & ECF_MALLOC) != 0, 1);
+ bp_pack_value (bp, (flags & ECF_NOTHROW) != 0, 1);
+ bp_pack_value (bp, (flags & ECF_RETURNS_TWICE) != 0, 1);
+ /* Flags that should not appear on indirect calls. */
+ gcc_assert (!(flags & (ECF_LOOPING_CONST_OR_PURE
+ | ECF_MAY_BE_ALLOCA
+ | ECF_SIBCALL
+ | ECF_NOVOPS)));
+ }
lto_output_bitpack (ob->main_stream, bp);
bitpack_delete (bp);
}
@@ -1060,6 +1075,7 @@ input_edge (struct lto_input_block *ib, VEC(cgraph_node_ptr, heap) *nodes,
cgraph_inline_failed_t inline_failed;
struct bitpack_d *bp;
enum ld_plugin_symbol_resolution caller_resolution;
+ int ecf_flags = 0;
caller = VEC_index (cgraph_node_ptr, nodes, lto_input_sleb128 (ib));
if (caller == NULL || caller->decl == NULL_TREE)
@@ -1091,7 +1107,7 @@ input_edge (struct lto_input_block *ib, VEC(cgraph_node_ptr, heap) *nodes,
return;
if (indirect)
- edge = cgraph_create_indirect_edge (caller, NULL, count, freq, nest);
+ edge = cgraph_create_indirect_edge (caller, NULL, 0, count, freq, nest);
else
edge = cgraph_create_edge (caller, callee, NULL, count, freq, nest);
@@ -1100,6 +1116,22 @@ input_edge (struct lto_input_block *ib, VEC(cgraph_node_ptr, heap) *nodes,
edge->inline_failed = inline_failed;
edge->call_stmt_cannot_inline_p = bp_unpack_value (bp, 1);
edge->can_throw_external = bp_unpack_value (bp, 1);
+ if (indirect)
+ {
+ if (bp_unpack_value (bp, 1))
+ ecf_flags |= ECF_CONST;
+ if (bp_unpack_value (bp, 1))
+ ecf_flags |= ECF_PURE;
+ if (bp_unpack_value (bp, 1))
+ ecf_flags |= ECF_NORETURN;
+ if (bp_unpack_value (bp, 1))
+ ecf_flags |= ECF_MALLOC;
+ if (bp_unpack_value (bp, 1))
+ ecf_flags |= ECF_NOTHROW;
+ if (bp_unpack_value (bp, 1))
+ ecf_flags |= ECF_RETURNS_TWICE;
+ edge->indirect_info->ecf_flags = ecf_flags;
+ }
bitpack_delete (bp);
}