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: [PR 68851] Do not collect thunks in callect_callers


> Hi,
> 
> in PR 68851, IPA-CP decides to clone for all known contexts, even when
> it is not local because the code is not supposed to grow anyway.  The
> code doing that uses collect_callers method of cgraph_edge to find all
> the edges which are to be redirected in such case.  However, there is
> also an edge from a hunk to the cloned node and that gets collected
> and redirected too.  Later on, this inconsistency (a thunk calling a
> wrong node) leads to an assert in comdat handling, but it can lead to
> all sorts of trouble.
> 
> The following patch fixes it by checking that thunks are not added
> into the vector in that method (which is only used by IPA-CP at this
> one spot and IPA-SRA so it should be fine).  Bootstrapped and tested
> on x86_64-linux.  OK for trunk?  And perhaps for the gcc-5 branch too?
> 
> Thanks,
> 
> Martin
> 
> 
> 2015-12-14  Martin Jambor  <mjambor@suse.cz>
> 
> 	PR ipa/68851
> 	* cgraph.c (collect_callers_of_node_1): Do not collect thunks.
> 	* cgraph.h (cgraph_node): Change comment of collect_callers.
> 
> testsuite/
> 	* g++.dg/ipa/pr68851.C: New test.

This is OK (for branches too if it won't cause issues for a week)
thanks!
Honza


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