This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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]

-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


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