summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/except.c2
-rw-r--r--gcc/gcov-io.c2
-rw-r--r--gcc/profile.c21
-rw-r--r--gcc/varasm.c1
6 files changed, 39 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4534bbc904c..78365cd474f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+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>
* config.gcc (sparc-*-solaris2*): Handle Solaris 10 and up like
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index bfb4218d965..b0f2c9cd05f 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+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>
* typeck.c (c_expand_asm_operands): Take location_t, instead of
diff --git a/gcc/cp/except.c b/gcc/cp/except.c
index 962da966b49..1dc149a8685 100644
--- a/gcc/cp/except.c
+++ b/gcc/cp/except.c
@@ -143,6 +143,8 @@ build_eh_type_type (tree type)
if (!exp)
return NULL;
+ mark_used (exp);
+
return build1 (ADDR_EXPR, ptr_type_node, exp);
}
diff --git a/gcc/gcov-io.c b/gcc/gcov-io.c
index 820b1f61701..99731f79939 100644
--- a/gcc/gcov-io.c
+++ b/gcc/gcov-io.c
@@ -361,7 +361,7 @@ gcov_read_words (unsigned words)
memcpy (gcov_var.buffer, gcov_var.buffer + gcov_var.offset, 4);
}
#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
gcov_var.offset = 0;
gcov_var.length = excess;
diff --git a/gcc/profile.c b/gcc/profile.c
index 09949819064..082ed322e5a 100644
--- a/gcc/profile.c
+++ b/gcc/profile.c
@@ -280,6 +280,22 @@ compute_branch_probabilities (void)
gcov_type *exec_counts = get_exec_counts ();
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. */
alloc_aux_for_blocks (sizeof (struct bb_info));
@@ -315,6 +331,11 @@ compute_branch_probabilities (void)
if (exec_counts)
{
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
e->count = 0;
diff --git a/gcc/varasm.c b/gcc/varasm.c
index aea04148da2..e6d0189e312 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -1043,6 +1043,7 @@ notice_global_symbol (tree decl)
{
if ((!first_global_object_name || !weak_global_object_name)
&& TREE_PUBLIC (decl) && !DECL_COMMON (decl)
+ && !DECL_EXTERNAL (decl)
&& (TREE_CODE (decl) == FUNCTION_DECL
|| (TREE_CODE (decl) == VAR_DECL
&& (DECL_INITIAL (decl) != 0