Commit 7e044261 by Jan Hubicka Committed by Jan Hubicka

coverage.c (coverage_compute_profile_id): Return non-0; also handle symbols with unique name.


	* coverage.c (coverage_compute_profile_id): Return non-0;
	also handle symbols with unique name.
	(coverage_end_function): Do not skip DECL_EXTERNAL functions.

From-SVN: r214232
parent 0d43a91d
2014-08-20 Jan Hubicka <hubicka@ucw.cz>
* coverage.c (coverage_compute_profile_id): Return non-0;
also handle symbols with unique name.
(coverage_end_function): Do not skip DECL_EXTERNAL functions.
2014-08-20 Steve Ellcey <sellcey@mips.com> 2014-08-20 Steve Ellcey <sellcey@mips.com>
PR middle-end/49191 PR middle-end/49191
......
...@@ -579,7 +579,7 @@ coverage_compute_profile_id (struct cgraph_node *n) ...@@ -579,7 +579,7 @@ coverage_compute_profile_id (struct cgraph_node *n)
unsigned chksum; unsigned chksum;
/* Externally visible symbols have unique name. */ /* Externally visible symbols have unique name. */
if (TREE_PUBLIC (n->decl) || DECL_EXTERNAL (n->decl)) if (TREE_PUBLIC (n->decl) || DECL_EXTERNAL (n->decl) || n->unique_name)
{ {
chksum = coverage_checksum_string chksum = coverage_checksum_string
(0, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (n->decl))); (0, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (n->decl)));
...@@ -601,8 +601,10 @@ coverage_compute_profile_id (struct cgraph_node *n) ...@@ -601,8 +601,10 @@ coverage_compute_profile_id (struct cgraph_node *n)
(chksum, aux_base_name); (chksum, aux_base_name);
} }
/* Non-negative integers are hopefully small enough to fit in all targets. */ /* Non-negative integers are hopefully small enough to fit in all targets.
return chksum & 0x7fffffff; Gcov file formats wants non-zero function IDs. */
chksum = chksum & 0x7fffffff;
return chksum + (!chksum);
} }
/* Compute cfg checksum for the function FN given as argument. /* Compute cfg checksum for the function FN given as argument.
...@@ -692,11 +694,6 @@ coverage_end_function (unsigned lineno_checksum, unsigned cfg_checksum) ...@@ -692,11 +694,6 @@ coverage_end_function (unsigned lineno_checksum, unsigned cfg_checksum)
{ {
struct coverage_data *item = 0; struct coverage_data *item = 0;
/* If the function is extern (i.e. extern inline), then we won't
be outputting it, so don't chain it onto the function
list. */
if (!DECL_EXTERNAL (current_function_decl))
{
item = ggc_alloc<coverage_data> (); item = ggc_alloc<coverage_data> ();
if (PARAM_VALUE (PARAM_PROFILE_FUNC_INTERNAL_ID)) if (PARAM_VALUE (PARAM_PROFILE_FUNC_INTERNAL_ID))
...@@ -714,7 +711,6 @@ coverage_end_function (unsigned lineno_checksum, unsigned cfg_checksum) ...@@ -714,7 +711,6 @@ coverage_end_function (unsigned lineno_checksum, unsigned cfg_checksum)
item->next = 0; item->next = 0;
*functions_tail = item; *functions_tail = item;
functions_tail = &item->next; functions_tail = &item->next;
}
for (i = 0; i != GCOV_COUNTERS; i++) for (i = 0; i != GCOV_COUNTERS; i++)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment