OSDN Git Service

PR gcov/profile/26570
authorrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 17 Aug 2006 00:13:24 +0000 (00:13 +0000)
committerrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 17 Aug 2006 00:13:24 +0000 (00:13 +0000)
* value-prof.c (static_values): Removed.
(tree_find_values_to_profile): Do not set static_values.
(find_values_to_profile): Do not free static_values.
* profile.c (instrument_values): Do not free the values.
(branch_prob): Free the values.

* gcc.dg/pr26570.c: New test.

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

gcc/ChangeLog
gcc/profile.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr26570.c [new file with mode: 0644]
gcc/value-prof.c

index 31adfc7..f4c0ff4 100644 (file)
@@ -1,3 +1,12 @@
+2006-08-16  Zdenek Dvorak <dvorakz@suse.cz>
+
+       PR gcov/profile/26570
+       * value-prof.c (static_values): Removed.
+       (tree_find_values_to_profile): Do not set static_values.
+       (find_values_to_profile): Do not free static_values.
+       * profile.c (instrument_values): Do not free the values.
+       (branch_prob): Free the values.
+
 2006-08-16  Naveen.H.S  <naveenh@kpitcummins.com>
 
        * config/m32c/m32c_lib1.S (__mulsi3): Use only registers for dest.
index 4e2213a..9b49309 100644 (file)
@@ -220,7 +220,6 @@ instrument_values (histogram_values values)
          gcc_unreachable ();
        }
     }
-  VEC_free (histogram_value, heap, values);
 }
 \f
 
@@ -1049,6 +1048,7 @@ branch_prob (void)
 
   free_aux_for_edges ();
 
+  VEC_free (histogram_value, heap, values);
   free_edge_list (el);
   if (flag_branch_probabilities)
     profile_status = PROFILE_READ;
index ce97baf..9a6bf56 100644 (file)
@@ -1,3 +1,8 @@
+2006-08-16  Zdenek Dvorak <dvorakz@suse.cz>
+
+       PR gcov/profile/26570
+       * gcc.dg/pr26570.c: New test.
+
 2006-08-16  Joseph S. Myers  <joseph@codesourcery.com>
 
        PR c/27697
diff --git a/gcc/testsuite/gcc.dg/pr26570.c b/gcc/testsuite/gcc.dg/pr26570.c
new file mode 100644 (file)
index 0000000..9041ee4
--- /dev/null
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fprofile-generate -fprofile-use" } */
+
+unsigned test (unsigned a, unsigned b)
+{
+  return a / b;
+} /* { dg-warning "execution counts estimated" } */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fprofile-generate -fprofile-use" } */
+
+unsigned test (unsigned a, unsigned b)
+{
+  return a / b;
+} /* { dg-warning "execution counts estimated" } */
index e273a40..6c64e3c 100644 (file)
@@ -46,12 +46,6 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
 
 static struct value_prof_hooks *value_prof_hooks;
 
-/* This is the vector of histograms.  Created in find_values_to_profile.
-   During profile generation, freed by instrument_values.
-   During profile use, freed by value_profile_transformations.  */
-
-static histogram_values static_values = NULL;
-
 /* In this file value profile based optimizations are placed.  Currently the
    following optimizations are implemented (for more detailed descriptions
    see comments at value_profile_transformations):
@@ -797,7 +791,6 @@ tree_find_values_to_profile (histogram_values *values)
   FOR_EACH_BB (bb)
     for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
       tree_values_to_profile (bsi_stmt (bsi), values);
-  static_values = *values;
   
   for (i = 0; VEC_iterate (histogram_value, *values, i, hist); i++)
     {
@@ -875,9 +868,7 @@ find_values_to_profile (histogram_values *values)
 bool
 value_profile_transformations (void)
 {
-  bool retval = (value_prof_hooks->value_profile_transformations) ();
-  VEC_free (histogram_value, heap, static_values);
-  return retval;
+  return (value_prof_hooks->value_profile_transformations) ();
 }
 \f