This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Make redirection only for target_clones: V2 (PR ipa/85329).
On Thu, Apr 12, 2018 at 07:53:35PM +0200, Jakub Jelinek wrote:
> On Thu, Apr 12, 2018 at 03:46:26PM +0200, Jan Hubicka wrote:
> > If you make C++ inline and get the idea to use target cloning attribute on this,
> > this will likely lead to link error if you compile multiple files because you
> > turn comdat to non-comdat.
> >
> > For comdats this woudl effectivly need to become C++ abi extension and we would
> > need to define comdat sections for these. Perhaps easiest way is to simply
> > reject the attribute on comdats and probaby also extern functions?
>
> I'm not really sure we can do that, various packages in the wild are already
> using this.
> What is the problem with comdats and multi-versioning?
> The question is what comdat groups we should use for the comdat resolver and
> the versioned functions, shall the ifunc symbol be the original mangling of
> the method (or other comdat) and the other entrypoints just be .local
> non-weak symbols inside of the same section?
Ah, but we emit the resolver only if we see a use of it. That sounds quite
broken, resolver in each TU that uses it? Better to have one at each
definition...
Jakub