summaryrefslogtreecommitdiff
path: root/gcc/lto-cgraph.c
diff options
context:
space:
mode:
authorienkovich <ienkovich@138bc75d-0d04-0410-961f-82ee72b054a4>2015-06-03 08:29:28 +0000
committerienkovich <ienkovich@138bc75d-0d04-0410-961f-82ee72b054a4>2015-06-03 08:29:28 +0000
commit7f0dce599fc3079b81629b785321620db9e1cbdc (patch)
tree2937d0650a54355694d28bd857d54e78bcd1f876 /gcc/lto-cgraph.c
parentbb5414b4eb5e88aa172b8c23bba07bc0df417c2d (diff)
downloadgcc-7f0dce599fc3079b81629b785321620db9e1cbdc.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@224063 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lto-cgraph.c')
-rw-r--r--gcc/lto-cgraph.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c
index b306c28d37b..b5fd83ee7ab 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)