This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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: __builtin_* expansion to outcalls vs name space issues


On Feb  5, 2013, Roland McGrath <roland@hack.frob.com> wrote:

> 	  return __builtin_mempcpy (d, s, n);

> Without the "#if __GNUC__ ..." part, this code conforms strictly to C89.
> A slight departure to use a GCC extension like a __builtin_* function
> does not in any way indicate that the expectations of the name space
> rules for the program have changed.

But the __builtin_* functions are documented as potentially expanding to
a call to * when the compiler can't otherwise optimize it, so this
slight departure effectively brings the requirement for a mempcpy in the
global namespace into the picture.

Now, while it is our fault to expect something different from what the
GCC documentation explicitly states, it might make sense for GCC to
offer some reflection capabilities so that it can be queried on whether
the builtin would just expand to a regular call, or some a means to
provide a different function to be called should a regular call be
required.  However, I don't see how useful these would be in general; it
sounds a bit like a feature useful only for a specific user, very much
like the syscalls we don't want to add to our own exported features (oh,
no, I've crossed the rays! :-), so...  I'm not hopeful.

-- 
Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist      Red Hat Brazil Compiler Engineer


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