+2014-04-14 Jan Hubicka <hubicka@ucw.cz>
+
+ * ipa-utils.c (ipa_merge_profiles): Merge profile_id.
+ * coverage.c (coverage_compute_profile_id): Handle externally visible
+ symbols.
+
2014-04-14 Martin Jambor <mjambor@suse.cz>
* tree-sra.c (ipa_sra_preliminary_function_checks): Skip
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;
if (node->decl != prevailing_node->decl)
cgraph_release_function_body (node);
- /* Time profile merging */
- if (node->tp_first_run)
- prevailing_node->tp_first_run = prevailing_node->tp_first_run ?
- MIN (prevailing_node->tp_first_run, node->tp_first_run) :
- node->tp_first_run;
-
/* Finally remove the replaced node. */
cgraph_remove_node (node);
}