diff options
author | Zdenek Dvorak <dvorakz@suse.cz> | 2006-08-17 02:13:24 +0200 |
---|---|---|
committer | Zdenek Dvorak <rakdver@gcc.gnu.org> | 2006-08-17 00:13:24 +0000 |
commit | 7e2f40afd4011439eee2750ca2a45f7bbd523f44 (patch) | |
tree | a22acd748f1104bb18682376f0fca37e65bada6c /gcc | |
parent | d8db3756c9f20b6f3f556b6ff22b91723ad16453 (diff) | |
download | gcc-7e2f40afd4011439eee2750ca2a45f7bbd523f44.zip gcc-7e2f40afd4011439eee2750ca2a45f7bbd523f44.tar.gz gcc-7e2f40afd4011439eee2750ca2a45f7bbd523f44.tar.bz2 |
PR gcov/profile/26570
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.
* gcc.dg/pr26570.c: New test.
From-SVN: r116197
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/profile.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr26570.c | 14 | ||||
-rw-r--r-- | gcc/value-prof.c | 11 |
5 files changed, 30 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 31adfc7..f4c0ff4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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. diff --git a/gcc/profile.c b/gcc/profile.c index 4e2213a..9b49309 100644 --- a/gcc/profile.c +++ b/gcc/profile.c @@ -220,7 +220,6 @@ instrument_values (histogram_values values) gcc_unreachable (); } } - VEC_free (histogram_value, heap, values); } @@ -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; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ce97baf..9a6bf56 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 index 0000000..9041ee4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr26570.c @@ -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" } */ diff --git a/gcc/value-prof.c b/gcc/value-prof.c index e273a40..6c64e3c 100644 --- a/gcc/value-prof.c +++ b/gcc/value-prof.c @@ -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) (); } |