diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2014-04-14 19:18:54 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2014-04-14 17:18:54 +0000 |
commit | cb90235dad713561e78ca7dd929218f22919cd24 (patch) | |
tree | 194491cc20ba14600662056b4a34f745b09db2e6 /gcc/coverage.c | |
parent | 7b3b340eafc59df1e79b9cb231722ea2507f04c7 (diff) | |
download | gcc-cb90235dad713561e78ca7dd929218f22919cd24.zip gcc-cb90235dad713561e78ca7dd929218f22919cd24.tar.gz gcc-cb90235dad713561e78ca7dd929218f22919cd24.tar.bz2 |
ipa-utils.c (ipa_merge_profiles): Merge profile_id.
* 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.
From-SVN: r209387
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 4c06fa4..ff1e67d 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; |