diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-04-14 17:18:54 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-04-14 17:18:54 +0000 |
commit | df565eb6455102b600518f159d9858be42fe9256 (patch) | |
tree | 194491cc20ba14600662056b4a34f745b09db2e6 /gcc/coverage.c | |
parent | fa484aac04f07d72fddcb3dfb37f29f02d394c60 (diff) | |
download | gcc-df565eb6455102b600518f159d9858be42fe9256.tar.gz |
* ipa-utils.c (ipa_merge_profiles): Merge profile_id.
* coverage.c (coverage_compute_profile_id): Handle externally visible
symbols.
* lto/lto-symtab.c (lto_cgraph_replace_node): Don't re-merge
tp_first_run.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@209387 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/coverage.c')
-rw-r--r-- | gcc/coverage.c | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/gcc/coverage.c b/gcc/coverage.c index 4c06fa47908..ff1e67d0a03 100644 --- a/gcc/coverage.c +++ b/gcc/coverage.c @@ -555,18 +555,29 @@ coverage_compute_lineno_checksum (void) unsigned coverage_compute_profile_id (struct cgraph_node *n) { - expanded_location xloc - = expand_location (DECL_SOURCE_LOCATION (n->decl)); - unsigned chksum = xloc.line; + unsigned chksum; - chksum = coverage_checksum_string (chksum, xloc.file); - chksum = coverage_checksum_string - (chksum, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (n->decl))); - if (first_global_object_name) - chksum = coverage_checksum_string - (chksum, first_global_object_name); - chksum = coverage_checksum_string - (chksum, aux_base_name); + /* Externally visible symbols have unique name. */ + if (TREE_PUBLIC (n->decl) || DECL_EXTERNAL (n->decl)) + { + chksum = coverage_checksum_string + (0, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (n->decl))); + } + else + { + expanded_location xloc + = expand_location (DECL_SOURCE_LOCATION (n->decl)); + + chksum = xloc.line; + chksum = coverage_checksum_string (chksum, xloc.file); + chksum = coverage_checksum_string + (chksum, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (n->decl))); + if (first_global_object_name) + chksum = coverage_checksum_string + (chksum, first_global_object_name); + chksum = coverage_checksum_string + (chksum, aux_base_name); + } /* Non-negative integers are hopefully small enough to fit in all targets. */ return chksum & 0x7fffffff; |