aboutsummaryrefslogtreecommitdiff
path: root/gcc/rtl-profile.c
diff options
context:
space:
mode:
authorAndreas Krebbel <krebbel1@de.ibm.com>2004-10-28 16:19:26 +0000
committerJan Hubicka <hubicka@gcc.gnu.org>2004-10-28 16:19:26 +0000
commitf3df9541367d65608af843d2a56f4519343e769e (patch)
tree5b78eb120055abb834a6216175418c0de85cefd4 /gcc/rtl-profile.c
parent86ce0e3d22f4e6c973397e0fd65b2cf0dbfdf633 (diff)
downloadgcc-f3df9541367d65608af843d2a56f4519343e769e.zip
gcc-f3df9541367d65608af843d2a56f4519343e769e.tar.gz
gcc-f3df9541367d65608af843d2a56f4519343e769e.tar.bz2
profile.c (branch_prob): Call to init_edge_profiler added.
* profile.c (branch_prob): Call to init_edge_profiler added. * rtl-profile.c (rtl_init_edge_profiler): New function. (rtl_gen_edge_profiler): Replaced call to insert_insn_on_edge with call to safe_insert_insn_on_edge. (rtl_profile_hooks): rtl_init_edge_profiler added. * tree-profile.c (tree_init_edge_profiler): New function. (tree_profile_hooks): tree_init_edge_profiler added. * value-prof.h (profile_hooks) init_edge_profiler prototype added. From-SVN: r89764
Diffstat (limited to 'gcc/rtl-profile.c')
-rw-r--r--gcc/rtl-profile.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/gcc/rtl-profile.c b/gcc/rtl-profile.c
index 2d0c69cc..3439f47 100644
--- a/gcc/rtl-profile.c
+++ b/gcc/rtl-profile.c
@@ -64,6 +64,16 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "tree.h"
#include "ggc.h"
+/* Do initialization work for the edge profiler. */
+
+static void
+rtl_init_edge_profiler (void)
+{
+ /* gen_edge_profiler calls safe_insert_insn_on_edge which needs
+ register liveness data to be available. */
+ life_analysis (NULL, 0);
+}
+
/* Output instructions as RTL to increment the edge execution count. */
static void
@@ -85,7 +95,7 @@ rtl_gen_edge_profiler (int edgeno, edge e)
sequence = get_insns ();
end_sequence ();
- insert_insn_on_edge (sequence, e);
+ safe_insert_insn_on_edge (sequence, e);
rebuild_jump_labels (e->insns.r);
}
@@ -413,6 +423,7 @@ static FILE *rtl_profile_dump_file (void) {
struct profile_hooks rtl_profile_hooks =
{
+ rtl_init_edge_profiler,
rtl_gen_edge_profiler,
rtl_gen_interval_profiler,
rtl_gen_pow2_profiler,