Question about callgraph and call_stmt

Richard Biener richard.guenther@gmail.com
Tue Oct 13 13:29:52 GMT 2020


On Tue, Oct 13, 2020 at 2:40 PM Erick Ochoa
<erick.ochoa@theobroma-systems.com> wrote:
>
>
>
> On 13/10/2020 13:37, Richard Biener wrote:
> > On Tue, Oct 13, 2020 at 1:17 PM Erick Ochoa
> > <erick.ochoa@theobroma-systems.com> wrote:
> >>
> >> Hi,
> >>
> >> I am analyzing gimple calls during LTO.
> >
> > What's symtab->state at this point?
>
> The state is IPA_SSA_AFTER_INLINING.
>
> >
> >> I found a gimple call statement
> >> s that has the following properties:
> >>
> >> ```
> >> tree fndecl = gimple_call_fndecl(s)
> >> gcc_assert(fndecl)
> >> // That is, the gimple call returns a non-null fndecl.
> >> cgraph_node *n = cgraph_node::get(fndecl);
> >> gcc_assert(!n)
> >> // That is, there is no cgraph_node for this fndecl
> >> ```
> >>
> >> Does anyone know hot to obtain the cgraph_node in this case? Or
> >> alternatively, why there is no cgraph_node associated with this call
> >> statement? I have already tried with adding TODO_rebuild_cgraph_edges
> >> before running my pass but I suspect this has more to do with gimple
> >> than with the call graph.
> >
> > what's the particular fndecl?
>
> The callsite is in a function that has been inlined and specialized. The
> callsite calls a function that is not inlined but has also been
> specialized. I'll try reducing my test case a bit.

So you eventually shouldn't look at bodies saved just for inlining
(node->inlined_to)

Richard.

> >
> >>
> >> Thanks!


More information about the Gcc mailing list