Commit f820b0cf by Jan Hubicka Committed by Jan Hubicka

re PR c++/12175 (Tru64 UNIX bootstrap failure: multiply defined symbols linking libstdc++.so)


	PR c++/12175
	* varasm.c (notice_global_symbol): Discard external symbols.

	PR optimization/12286
	* gcov-io.c (gcov_read_words): Fix memmove call.
	* profile.c (compute_branch_probabilities): Add extra sanity checks.

	PR C++/12047
	* except.c (build_eh_type_type): Call mark_used on the type.

From-SVN: r71916
parent 2cd56142
Mon Sep 29 22:59:05 CEST 2003 Jan Hubicka <jh@suse.cz>
PR c++/12175
* varasm.c (notice_global_symbol): Discard external symbols.
PR optimization/12286
* gcov-io.c (gcov_read_words): Fix memmove call.
* profile.c (compute_branch_probabilities): Add extra sanity checks.
2003-09-29 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> 2003-09-29 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* config.gcc (sparc-*-solaris2*): Handle Solaris 10 and up like * config.gcc (sparc-*-solaris2*): Handle Solaris 10 and up like
......
2003-09-29 Jan Hubicka <jh@suse.cz>
PR C++/12047
* except.c (build_eh_type_type): Call mark_used on the type.
2003-09-28 Richard Henderson <rth@redhat.com> 2003-09-28 Richard Henderson <rth@redhat.com>
* typeck.c (c_expand_asm_operands): Take location_t, instead of * typeck.c (c_expand_asm_operands): Take location_t, instead of
......
...@@ -143,6 +143,8 @@ build_eh_type_type (tree type) ...@@ -143,6 +143,8 @@ build_eh_type_type (tree type)
if (!exp) if (!exp)
return NULL; return NULL;
mark_used (exp);
return build1 (ADDR_EXPR, ptr_type_node, exp); return build1 (ADDR_EXPR, ptr_type_node, exp);
} }
......
...@@ -361,7 +361,7 @@ gcov_read_words (unsigned words) ...@@ -361,7 +361,7 @@ gcov_read_words (unsigned words)
memcpy (gcov_var.buffer, gcov_var.buffer + gcov_var.offset, 4); memcpy (gcov_var.buffer, gcov_var.buffer + gcov_var.offset, 4);
} }
#else #else
memmove (gcov_var.buffer, gcov_var.buffer + gcov_var.offset, excess); memmove (gcov_var.buffer, gcov_var.buffer + gcov_var.offset, excess * 4);
#endif #endif
gcov_var.offset = 0; gcov_var.offset = 0;
gcov_var.length = excess; gcov_var.length = excess;
......
...@@ -280,6 +280,22 @@ compute_branch_probabilities (void) ...@@ -280,6 +280,22 @@ compute_branch_probabilities (void)
gcov_type *exec_counts = get_exec_counts (); gcov_type *exec_counts = get_exec_counts ();
int exec_counts_pos = 0; int exec_counts_pos = 0;
/* Very simple sanity checks so we catch bugs in our profiling code. */
if (profile_info)
{
if (profile_info->run_max * profile_info->runs < profile_info->sum_max)
{
error ("corrupted profile info: run_max * runs < sum_max");
exec_counts = NULL;
}
if (profile_info->sum_all < profile_info->sum_max)
{
error ("corrupted profile info: sum_all is smaller than sum_max");
exec_counts = NULL;
}
}
/* Attach extra info block to each bb. */ /* Attach extra info block to each bb. */
alloc_aux_for_blocks (sizeof (struct bb_info)); alloc_aux_for_blocks (sizeof (struct bb_info));
...@@ -315,6 +331,11 @@ compute_branch_probabilities (void) ...@@ -315,6 +331,11 @@ compute_branch_probabilities (void)
if (exec_counts) if (exec_counts)
{ {
e->count = exec_counts[exec_counts_pos++]; e->count = exec_counts[exec_counts_pos++];
if (e->count > profile_info->sum_max)
{
error ("corrupted profile info: edge from %i to %i exceeds maximal count",
bb->index, e->dest->index);
}
} }
else else
e->count = 0; e->count = 0;
......
...@@ -1043,6 +1043,7 @@ notice_global_symbol (tree decl) ...@@ -1043,6 +1043,7 @@ notice_global_symbol (tree decl)
{ {
if ((!first_global_object_name || !weak_global_object_name) if ((!first_global_object_name || !weak_global_object_name)
&& TREE_PUBLIC (decl) && !DECL_COMMON (decl) && TREE_PUBLIC (decl) && !DECL_COMMON (decl)
&& !DECL_EXTERNAL (decl)
&& (TREE_CODE (decl) == FUNCTION_DECL && (TREE_CODE (decl) == FUNCTION_DECL
|| (TREE_CODE (decl) == VAR_DECL || (TREE_CODE (decl) == VAR_DECL
&& (DECL_INITIAL (decl) != 0 && (DECL_INITIAL (decl) != 0
......
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