This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
-builtin and C++
- From: Lubos Lunak <l dot lunak at sh dot cvut dot cz>
- To: gcc at gcc dot gnu dot org
- Date: Sun, 24 Feb 2002 23:13:47 +0100
- Subject: -builtin and C++
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