This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: IFUNC attribute
Hi,
On Wed, 14 Jul 2010, H.J. Lu wrote:
> On Wed, Jul 14, 2010 at 9:08 AM, Nathan Sidwell <nathan@codesourcery.com> wrote:
> > On 07/14/10 16:57, H.J. Lu wrote:
> >
> >> I don't see much value in this than the current scheme. I don't
> >> think it should go in.
> >
> > GCC doesn't have a current scheme for handling ifunc functions, I believe
> > you have to hack it up with asm inserts -- the same could be done to provide
> > the functionality of the alias attribute, and yet it is in GCC.
>
> As I said before, the current asm statement scheme works to
> certain degree. As far as user is concerned, your scheme is
> very similar and has the same drawbacks.
toplevel asms that fiddle with symbols have one huge drawback: they don't
work well with LTO. As in, the semantics of the asms are not known to the
compiler, for instance that creating an alias via asm, and using that
alias in C code make the aliased function necessary. Same with ifunc, the
resolver function would magically need to become necessary (e.g. via an
explicit 'used' attribute which has drawbacks too) with just asms, whereas
with an attribute it's obvious to the cgraph code.
It's really much better to be explicit to the compiler, hence attributes.
Ciao,
Michael.