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]

Re: gcc will become the best optimizing x86 compiler


On Tue, 29 Jul 2008, Steven Bosscher wrote:

> On Tue, Jul 29, 2008 at 11:26 AM, Richard Guenther
> <richard.guenther@gmail.com> wrote:
> >> g++ (v. 4.2.3) without any options converts memcpy with unknown size to  rep
> >> movsb
> >
> > Make sure to use -D__NO_STRING_INLINES to not get glibcs inline
> > implementation.
> 
> Why is this not the default?

Because GNU projects are supposed to work together rather than forcibly 
overriding each other.  As GCC gets optimizations that obsolete particular 
parts of the optimizations in glibc's headers, Jakub updates the glibc 
headers to have only those optimizations not obsoleted by GCC (some call 
particular glibc-specific functions GCC doesn't know about, for example), 
depending on the GCC version.  If GCC were to override glibc 
unconditionally, for all the inline implementations, then the natural 
consequence would be for glibc to change __NO_STRING_INLINES to 
__REALLY_NO_STRING_INLINES, and so on - this macro is for the user to 
override, if particular inlines are not needed or not optimal for 
particular compiler versions or processors then the headers should be 
updated in glibc.  If you have issues with particular inlines (not limited 
to string functions), please file bugs in glibc Bugzilla, send patches to 
libc-alpha or contact Jakub.

Anyone finding memcpy converted inappropriately needs to give the full 
testcase - both original and preprocessed source - and full command-line 
options, so we can tell what inlines if any are being used.

-- 
Joseph S. Myers
joseph@codesourcery.com


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