This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: __builtin_* expansion to outcalls vs name space issues
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: "GNU C. Library" <libc-alpha at sourceware dot org>
- Date: Tue, 5 Feb 2013 23:31:47 +0000
- Subject: Re: __builtin_* expansion to outcalls vs name space issues
- References: <20130205203545.C78F72C074@topped-with-meat.com>
On Tue, 5 Feb 2013, Roland McGrath wrote:
> What should be the expectation of responsibility here? On the one hand,
> it seems vaguely reasonable that __builtin_foobar degenerates to calling
> foobar.
Yes, that's expected. (There is however a known GCC bug where calls may
be generated to functions that aren't reserved and without a corresponding
__builtin_* call: <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46926>.
But it's always expected that not all __builtin_* calls are expanded
inline.)
> So, are we wrong for using __builtin_mempcpy in a place where a call to
> mempcpy is not kosher?
Yes. Declaring mempcpy with __asm__ ("__mempcpy") should cause
__builtin_mempcpy to generate a call to __mempcpy.
--
Joseph S. Myers
joseph@codesourcery.com