summaryrefslogtreecommitdiff
path: root/gcc/coverage.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2014-04-14 17:18:54 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2014-04-14 17:18:54 +0000
commitdf565eb6455102b600518f159d9858be42fe9256 (patch)
tree194491cc20ba14600662056b4a34f745b09db2e6 /gcc/coverage.c
parentfa484aac04f07d72fddcb3dfb37f29f02d394c60 (diff)
downloadgcc-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.c33
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;