This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: pretty-ipa merge part 19: Clonning infrastructure
On Tue, 12 May 2009, Jan Hubicka wrote:
> > >
> > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40079
>
> Hi,
> there is one remaining thunk-3.C failure showing on some targets. It is
> interesting problem: there is virtual constructor bar with associated
> thunk. We manage to devirutalize only call to bar and render table of
> virtual methods unnecesary, as a result we remove function bar itself in
> favour of its clone where we propagate some constant.
>
> Problem is that clonning of decl is done via copy_decl and
> emit_associated_thunks later called when compiling the clone results in
> emitting thunk (that is dead) pointing to the original function
> resulting in reference to undefined symbol.
>
> Mark, is there any easy way to prevent C++ from emitting thunks on
> clones? If not, I can fix it on callgraph side: simply track what nodes
They are emitted at the time the clones are created - thus very early.
The proper fix is to defer to the inliner to do the cloning and to
re-implement thunks like Diego suggested for LTO. For the former
I had sent some patches in the past, as part of bringing gimplification
to unit-at-a-time (at least to you personally, I don't remember if
I sent the inliner parts to the list).
Richard.