diff options
author | Ilya Enkovich <ilya.enkovich@intel.com> | 2015-06-03 08:29:28 +0000 |
---|---|---|
committer | Ilya Enkovich <ienkovich@gcc.gnu.org> | 2015-06-03 08:29:28 +0000 |
commit | 48de5d37c34a0d18b4f0e19e9ab3f661586ae9ee (patch) | |
tree | 2937d0650a54355694d28bd857d54e78bcd1f876 /gcc/lto-cgraph.c | |
parent | b2858c9f3ed8275a61ee02421b8fc51ab070c79e (diff) | |
download | gcc-48de5d37c34a0d18b4f0e19e9ab3f661586ae9ee.zip gcc-48de5d37c34a0d18b4f0e19e9ab3f661586ae9ee.tar.gz gcc-48de5d37c34a0d18b4f0e19e9ab3f661586ae9ee.tar.bz2 |
ipa.c (symbol_table::remove_unreachable_nodes): Don't remove instumentation thunks calling reachable functions.
gcc/
* ipa.c (symbol_table::remove_unreachable_nodes): Don't
remove instumentation thunks calling reachable functions.
* lto-cgraph.c (output_refs): Always output IPA_REF_CHKP.
* lto/lto-partition.c (privatize_symbol_name_1): New.
(privatize_symbol_name): Privatize both decl and orig_decl
names for instrumented functions.
* cgraph.c (cgraph_node::verify_node): Add transparent
alias chain check for instrumented node.
gcc/testsuite/
* gcc.dg/lto/chkp-privatize-1_0.c: New.
* gcc.dg/lto/chkp-privatize-1_1.c: New.
* gcc.dg/lto/chkp-privatize-2_0.c: New.
* gcc.dg/lto/chkp-privatize-2_1.c: New.
From-SVN: r224063
Diffstat (limited to 'gcc/lto-cgraph.c')
-rw-r--r-- | gcc/lto-cgraph.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c index b306c28..b5fd83e 100644 --- a/gcc/lto-cgraph.c +++ b/gcc/lto-cgraph.c @@ -806,8 +806,33 @@ output_refs (lto_symtab_encoder_t encoder) { symtab_node *node = lto_symtab_encoder_deref (encoder, i); + /* IPA_REF_ALIAS and IPA_REF_CHKP references are always preserved + in the boundary. Alias node can't have other references and + can be always handled as if it's not in the boundary. */ if (!node->alias && !lto_symtab_encoder_in_partition_p (encoder, node)) - continue; + { + cgraph_node *cnode = dyn_cast <cgraph_node *> (node); + /* Output IPA_REF_CHKP reference. */ + if (cnode + && cnode->instrumented_version + && !cnode->instrumentation_clone) + { + for (int i = 0; node->iterate_reference (i, ref); i++) + if (ref->use == IPA_REF_CHKP) + { + if (lto_symtab_encoder_lookup (encoder, ref->referred) + != LCC_NOT_FOUND) + { + int nref = lto_symtab_encoder_lookup (encoder, node); + streamer_write_gcov_count_stream (ob->main_stream, 1); + streamer_write_uhwi_stream (ob->main_stream, nref); + lto_output_ref (ob, ref, encoder); + } + break; + } + } + continue; + } count = node->ref_list.nreferences (); if (count) |