summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog.melt8
-rw-r--r--gcc/cfg.c2
-rw-r--r--gcc/compiler-probe.c21
-rw-r--r--gcc/gimple-pretty-print.c3
-rw-r--r--gcc/passes.c6
5 files changed, 32 insertions, 8 deletions
diff --git a/gcc/ChangeLog.melt b/gcc/ChangeLog.melt
index 87d5671513a..db325720f0a 100644
--- a/gcc/ChangeLog.melt
+++ b/gcc/ChangeLog.melt
@@ -1,4 +1,12 @@
2008-09-02 Basile Starynkevitch <basile@starynkevitch.net>
+ compiler probe still buggy!
+ * cfg.c (check_bb_profile): Added return if cfun is null.
+ * gimple-pretty-print.c (gimple_dump_bb_buff): Don't dump phi nodes when none.
+ * compiler_probe (bb_starting_displayer): More robust, and more debugprintf...
+ (pass_compiler_probe) requirements are only PROP_cfg.
+ * passes.c (init_optimization_passes): moved pass_compiler_probe.
+
+2008-09-02 Basile Starynkevitch <basile@starynkevitch.net>
* basilys.c (basilys_inform_str): added loc argument to inform.
2008-09-01 Basile Starynkevitch <basile@starynkevitch.net>
diff --git a/gcc/cfg.c b/gcc/cfg.c
index 1f681124105..c49aa9dff13 100644
--- a/gcc/cfg.c
+++ b/gcc/cfg.c
@@ -450,7 +450,7 @@ check_bb_profile (basic_block bb, FILE * file)
gcov_type lsum;
edge_iterator ei;
- if (profile_status == PROFILE_ABSENT)
+ if (!cfun || profile_status == PROFILE_ABSENT)
return;
if (bb != EXIT_BLOCK_PTR)
diff --git a/gcc/compiler-probe.c b/gcc/compiler-probe.c
index e33eeac37ef..f5049ba654f 100644
--- a/gcc/compiler-probe.c
+++ b/gcc/compiler-probe.c
@@ -1436,11 +1436,15 @@ bb_starting_displayer (struct comprobe_whatpos_st *wp,
comprobe_ix_t ix = (comprobe_ix_t) data;
char pfx[24];
basic_block bb = NULL;
+ gimple_seq phis = NULL;
debugeprintf ("bb_starting_displayer ix %d", (int) ix);
comprobe_bb_ok_rtl = 1;
if (ix > 0 && ix < VEC_length (basic_block, unique_bb_vector))
{
bb = VEC_index (basic_block, unique_bb_vector, ix);
+ debugeprintf ("bb_starting_displayer bb %p", (void*) bb);
+ if (flag_compiler_probe_debug)
+ gimple_debug_bb(bb);
comprobe_printf
("// starting basic block _%ld #%d shown when '%s' \n// from gcc file %s line %d\n",
(long) ix, di->idis_infp->infp_num, wp->wp_what,
@@ -1451,19 +1455,23 @@ bb_starting_displayer (struct comprobe_whatpos_st *wp,
dump_bb_info (bb, true, true,
TDF_DETAILS | TDF_LINENO | TDF_VOPS | TDF_MEMSYMS,
pfx, comprobe_replf);
- if (phi_nodes(bb))
+ phis = phi_nodes(bb);
+ debugeprintf ("bb_starting_displayer phis %p", (void*) phis);
+ if (phis)
{
- gimple_stmt_iterator gsi;
+ gimple_stmt_iterator gsi = {0};
comprobe_printf ("\n// basic block phi_nodes _%ld #%d is\n",
ix, di->idis_infp->infp_num);
- for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi)) {
+ for (gsi = gsi_start (phis); !gsi_end_p (gsi); gsi_next (&gsi)) {
gimple g = gsi_stmt(gsi);
+ debugeprintf ("bb_starting_displayer gimple g %p", (void*) g);
display_gimple(g, di);
comprobe_display_add_navigator
(di, tree_starting_displayer,
"phi nodes", comprobe_unique_index_of_gimple(g));
}
};
+ debugeprintf ("bb_starting_displayer again bb %p", (void*) bb);
/* basic blocks [almost?] always have statements */
{
gimple_stmt_iterator gsi;
@@ -1499,6 +1507,7 @@ bb_ending_displayer (struct comprobe_whatpos_st *wp,
if (ix > 0 && ix < VEC_length (basic_block, unique_bb_vector))
{
bb = VEC_index (basic_block, unique_bb_vector, ix);
+ debugeprintf ("bb_ending_displayer bb %p", (void*) bb);
comprobe_printf
("// ending basic block _%ld #%d shown when '%s'\n// from gcc file %s line %d\n",
ix, infoptrk, wp->wp_what, basename (wp->wp_file), wp->wp_line);
@@ -2241,9 +2250,11 @@ add_infopoint_basic_block (basic_block bb)
int stmtcnt = 0;
comprobe_ix_t bbix = 0;
bool bbgotpos = 0;
- debugeprintf ("add_infopoint_basic_block bb %p start", (void*)bb);
+ debugeprintf ("add_infopoint_basic_block bb %p #%d start", (void*)bb, bb?bb->index:-1);
if (bb == NULL)
return;
+ if (flag_compiler_probe_debug)
+ dump_bb(bb, stderr, 0);
bbix = comprobe_unique_index_of_basic_block (bb);
gcc_assert (bbix > 2);
bbgotpos = FALSE;
@@ -2359,7 +2370,7 @@ struct gimple_opt_pass pass_compiler_probe =
NULL, /* next */
0, /* static_pass_number */
0, /* tv_id */
- 0 /*PROP_cfg | PROP_ssa */ , /* properties_required */
+ PROP_cfg, /* properties_required */
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
diff --git a/gcc/gimple-pretty-print.c b/gcc/gimple-pretty-print.c
index d334d856982..f2b0cf1ed4f 100644
--- a/gcc/gimple-pretty-print.c
+++ b/gcc/gimple-pretty-print.c
@@ -1822,7 +1822,8 @@ gimple_dump_bb_buff (pretty_printer *buffer, basic_block bb, int indent,
label_indent = 0;
dump_bb_header (buffer, bb, indent, flags);
- dump_phi_nodes (buffer, bb, indent, flags);
+ if (phi_nodes(bb))
+ dump_phi_nodes (buffer, bb, indent, flags);
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
diff --git a/gcc/passes.c b/gcc/passes.c
index 3c0a5812a7b..93585ae4836 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -653,6 +653,8 @@ init_optimization_passes (void)
NEXT_PASS (pass_pre);
NEXT_PASS (pass_sink_code);
NEXT_PASS (pass_tree_loop);
+ /* pass_compiler_probe does not work here */
+
{
struct opt_pass **p = &pass_tree_loop.pass.sub;
NEXT_PASS (pass_tree_loop_init);
@@ -715,12 +717,14 @@ init_optimization_passes (void)
NEXT_PASS (pass_basilys_lateopt);
#endif /*ENABLE_BASILYSMELT*/
}
+
NEXT_PASS (pass_del_ssa);
NEXT_PASS (pass_nrv);
NEXT_PASS (pass_mark_used_blocks);
NEXT_PASS (pass_cleanup_cfg_post_optimizing);
-#if ENABLE_COMPILER_PROBE
+
+#if ENABLE_COMPILER_PROBE
NEXT_PASS(pass_compiler_probe);
#endif