-builtin and C++
Lubos Lunak
l.lunak@sh.cvut.cz
Sun Feb 24 14:20:00 GMT 2002
Hello,
could somebody please explain to me why gcc3 doesn't use builtin functions
for memcpy() etc. in C++ even when explicitly told so with -fbuiltin?
The info documentation describing -fbuiltin says:
In C++, `-fno-builtin' is always in effect. The `-fbuiltin'
option has no effect. Therefore, in C++, the only way to get the
optimization benefits of built-in functions is to call the function
using the `__builtin_' prefix. The GNU C++ Standard Library uses
built-in functions to implement many functions (like
`std::strchr'), so that you automatically get efficient code.
Why has one to manually replace memcpy -> __builtin_memcpy etc. in order to
get better optimization when gcc should(?) be able to do so itself? Why
doesn't gcc do it?
Thanks
--
Lubos Lunak
llunak@suse.cz ; l.lunak@kde.org
http://dforce.sh.cvut.cz/~seli
More information about the Gcc
mailing list