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: Fix removal of ctors/dtors


> Hi,
> 
> On Tue, Oct 26, 2010 at 04:16:04PM +0200, Jan Hubicka wrote:
> > Finally both inliner and ipa-cp confuse handling of functions with
> > address taken.  ipa-cp is considering functions with address taken
> > to be cloning candidates.  This is wrong.  We should clone only when
> > we think original function is not called at all but we can't say for
> > sure since it is externally visible.  Clonning is of course
> > possible, but current impementation leads to wrong code when
> > updating call sites of calls promoted to be direct.
> > 
> 
> We have had similar issues before but so far managed to get around
> them without such a big hammer.  Do you have a testcase that will fail
> if I remove the ipa-cp hunk?

The problem I ran into was that ipa-cp tried to propagate across function with
adress taken without clonning it.  This is obviously wrong, so the first part
of ipa-cp change (reducing non-clonning propagation to local function only) is
IMO only correct way.

We can support clonning functions with address taken, but I am not sure how
desriable it is: I think the idea of current ipa-cp implementation is to clone
only when all calls in current unit have same constant operand. Taking address
imply an indirect call where we know nothing.  So clonning functions with
address taken is more work for the clonning pass we don't have (yet:).

You might try to revert the second change and ensure that we do update edges
correctly when ipa-cp promote indirect call to dirrect call.

Honza


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