I just found this in tree-cfg.c; the comment is probably wrong with
respect to const and pure. What do you think?
/* Return true if we need to add fake edge to exit at statement T.
Helper function for tree_flow_call_edges_add. */
static bool
need_fake_edge_p (tree t)
{
tree call;
/* NORETURN and LONGJMP calls already have an edge to exit.
CONST and PURE calls do not need one.
We don't currently check for CONST and PURE here, although
it would be a good idea, because those attributes are
figured out from the RTL in mark_constant_function, and
the counter incrementation code from -fprofile-arcs
leads to different results from -fbranch-probabilities. */
call = get_call_expr_in (t);
if (call
&& !(call_expr_flags (call) & ECF_NORETURN))
return true;
if (TREE_CODE (t) == ASM_EXPR
&& (ASM_VOLATILE_P (t) || ASM_INPUT_P (t)))
return true;
return false;
}
Paolo