This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Parameters added for coverage_compute_cfg_checksum
- From: Martin LiÅka <marxin dot liska at gmail dot com>
- To: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 19 Nov 2013 09:48:53 +0100
- Subject: [PATCH] Parameters added for coverage_compute_cfg_checksum
- Authentication-results: sourceware.org; auth=none
Hello,
I will need for my further patch more general usage of
coverage_compute_cfg_checksum function, so that I added new argument.
Is the patch OK?
Thank you,
Martin
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d759d4c..32ffc2e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2013-11-19 Martin Liska <marxin.liska@gmail.com>
+
+ * gcc/coverage.c (coverage_compute_cfg_checksum): Parameters introduced.
+ * gcc/profile.c (branch_prob): Argument added.
+
2013-11-19 Jeff Law <law@redhat.com>
* tree-ssa-threadupdate.c: Include ssa-iterators.h
diff --git a/gcc/coverage.c b/gcc/coverage.c
index 3f4e334..f0bdc1c 100644
--- a/gcc/coverage.c
+++ b/gcc/coverage.c
@@ -581,12 +581,12 @@ coverage_compute_profile_id (struct cgraph_node *n)
but the compiler won't detect the change and use the wrong profile data. */
unsigned
-coverage_compute_cfg_checksum (void)
+coverage_compute_cfg_checksum (struct function *fn)
{
basic_block bb;
- unsigned chksum = n_basic_blocks_for_fn (cfun);
+ unsigned chksum = n_basic_blocks_for_fn (fn);
- FOR_EACH_BB (bb)
+ FOR_EACH_BB_FN (bb, fn)
{
edge e;
edge_iterator ei;
diff --git a/gcc/coverage.h b/gcc/coverage.h
index 342d73e..a467c6e 100644
--- a/gcc/coverage.h
+++ b/gcc/coverage.h
@@ -32,8 +32,8 @@ extern int coverage_begin_function (unsigned, unsigned);
/* Complete the coverage information for the current function. */
extern void coverage_end_function (unsigned, unsigned);
-/* Compute the control flow checksum for the current function. */
-extern unsigned coverage_compute_cfg_checksum (void);
+/* Compute the control flow checksum for the function given as argument. */
+extern unsigned coverage_compute_cfg_checksum (struct function *);
/* Compute the profile id of function N. */
extern unsigned coverage_compute_profile_id (struct cgraph_node *n);
diff --git a/gcc/profile.c b/gcc/profile.c
index 1f1c265..cc0f5a5 100644
--- a/gcc/profile.c
+++ b/gcc/profile.c
@@ -1197,7 +1197,7 @@ branch_prob (void)
the checksum in only once place, since it depends on the shape
of the control flow which can change during
various transformations. */
- cfg_checksum = coverage_compute_cfg_checksum ();
+ cfg_checksum = coverage_compute_cfg_checksum (cfun);
lineno_checksum = coverage_compute_lineno_checksum ();
/* Write the data from which gcov can reconstruct the basic block