Hello All,
Those interested in my compiler probe (see my talk at GCC Summit 2007)
could glance a snapshot on
http://starynkevitch.net/Basile/gcc-probe-combine.png
and download a patch from
http://starynkevitch.net/Basile/basile-ggcc-patches.tgz
(which is updated frequently)
Now a question about basic_block flags (related to my compiler probe).
Several basic_block functions in gcc/tree-flow-inline.h contains the following
assertion:
gcc_assert (!(bb->flags & BB_RTL));
In particular, functions phi_nodes phi_nodes_ptr set_phi_nodes bb_stmt_list
set_bb_stmt_list
some of them are called from dump_bb_info (which my compiler probe calls)
Apparently, a basic_block can be dumped even if it has BB_RTL flag set. But
these assertions fails.
However, if they are disabled, the dump seems to happen normally.
Is there some risk in temporarily disabling theses assertions, for example with
a flag
which some routines could temporarily set?
FWIW, for my compiler probe, I defined an int variable comprobe_bb_ok_rtl and
replaced
the above assert with
gcc_assert (comprobe_bb_ok_rtl || !(bb->flags & BB_RTL));
and its worked ok. Since I am calling dump_bb_info quite lately (in a
pass_compiler_probe
just before pass_warn_function_noreturn) I also had to check for cfun, e.g. with
/* Basile: both maybe_hot_bb_p & probably_never_executed_bb_p
functions crash without cfun */
if (cfun && maybe_hot_bb_p (bb))
fprintf (file, ", maybe hot");
if (cfun && probably_never_executed_bb_p (bb))
fprintf (file, ", probably never executed");
Since both maybe_hot_bb_p & probably_never_executed_bb_p requires a valid cfun
Am I doing things wrongly? (I just want to dump stuff, not change it).
Regards.
--
Basile STARYNKEVITCH http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net | mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mine, sont seulement les miennes} ***