This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: fake edges for const and pure functions
- From: Jan Hubicka <jh at suse dot cz>
- To: Paolo Bonzini <paolo dot bonzini at lu dot unisi dot ch>
- Cc: GCC Development <gcc at gcc dot gnu dot org>, Jan Hubicka <jh at suse dot cz>
- Date: Mon, 2 Jan 2006 16:17:24 +0100
- Subject: Re: fake edges for const and pure functions
- References: <43B92C3D.3080507@lu.unisi.ch>
> I just found this in tree-cfg.c; the comment is probably wrong with
> respect to const and pure. What do you think?
Yes, it should be safe to remove the hack now when we do IPA profiling.
Thanks for noticing it ;)
Honza
>
> /* 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