This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, PR 42450] Consistent call statement redirection for inline clones


Hi,

On Wed, Mar 10, 2010 at 04:57:34PM +0100, Jan Hubicka wrote:
> > The problem in PR 42450 is slightly different from what I saw when
> > writing the patch.  The core problem is that an inline clone has three
> > outgoing edges, whereas its clone_of node has only two.  The third one
> > is removed along with the node it leads to by
> > cgraph_remove_unreachable_nodes.  The caller isn't removed but it is
> 
> Hmm, this is bad situation :(
> We keep the edges around in order to make tree-inline update call edges of
> the clones for new statements when they are created.  If some of them gets
> removed because the callee is unreachable, we run into problem.

I tried to find such updates in tree-inline but couldn't.  As far as I
know, the edges that are actually used... in fact, all edges always
point to the right places at all times (at least after each IPA pass
is finished).  It's the statements that need to be updated according
to them.

I don't thing this is something really bad.  In fact, instead I would
propose that we delete all outgoing edges of such unreachable nodes
that are kept around only to hold bodies so that they don't confuse
us.  But I assume that is what is done by the following:


> Does the patch work if you move cgraph_node_remove_callees out of
> the following conditional in ipa.c?
>                   if (!clone)
>                     { 
>                       cgraph_release_function_body (node);
>                       cgraph_node_remove_callees (node);
>                       node->analyzed = false;
>                       node->local.inlinable = false;
>                     }
> 

Yes, when I move the call from the if block, the PR is still not
present and there are no regressions among c, c++ and libstc++
testsuits.  I will do a full bootstrap and test round soon.

Thanks,

Martin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]