This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix cgraph_function_versioning (PR c++/39106)
On Thu, Feb 05, 2009 at 03:51:39PM -0500, Diego Novillo wrote:
> On Thu, Feb 5, 2009 at 15:42, Jakub Jelinek <jakub@redhat.com> wrote:
>
> > This testcase fails to compile on x86_64-linux and i686-linux at -O2/-O3
> > at least. The problem is that cgraph versioning clones bar (which has
> > an associated thunk) for versioning and afterwards decides to not emit the
> > original bar. As cgraph_function_versioning copies most of the FUNCTION_DECL,
> > including lang specific stuff and most of the flag bits, when cgraph calls
> > emit_associated_thunks on the cloned bar (T.7), thunks for the original bar
> > are emitted, but bar is not, thus the
> > error: 'bool A::*.LTHUNK0(A&, int) const' aliased to undefined symbol '_ZNK1EILi0EE3barER1Ai'
> > error is emitted.
>
> Wouldn't we need a thunk for the clone decl in that case?
I don't think so. The cloned function is always called only directly, not
exported from the CU. For all other uses is the original function (with its
thunks).
Jakub