PR c++/12175
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 29 Sep 2003 21:19:10 +0000 (21:19 +0000)
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 29 Sep 2003 21:19:10 +0000 (21:19 +0000)
* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@71916 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/cp/ChangeLog
gcc/cp/except.c
gcc/gcov-io.c
gcc/profile.c
gcc/varasm.c

index 4534bbc..78365cd 100644 (file)
@@ -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
index bfb4218..b0f2c9c 100644 (file)
@@ -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
index 962da96..1dc149a 100644 (file)
@@ -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);
 }
 
index 820b1f6..99731f7 100644 (file)
@@ -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;
index 0994981..082ed32 100644 (file)
@@ -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;
index aea0414..e6d0189 100644 (file)
@@ -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