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
This commit is contained in:
Zdenek Dvorak 2006-08-17 02:13:24 +02:00 committed by Zdenek Dvorak
parent d8db3756c9
commit 7e2f40afd4
5 changed files with 30 additions and 11 deletions

View 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.

View File

@ -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;

View 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

View File

@ -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" } */

View 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) ();
}