This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


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

Re: Should we optimize memset to bzero?


On Fri, Nov 02, 2001 at 08:28:49AM -0800, H . J . Lu wrote:
> Should we optimize memset to bzero? Like
> 
> #define memset(s, c, n) \
> (__extension__ ((__builtin_constant_p (c) && (c) == 0) \
> 		? __bzero ((s), (n)) : __memset ((s), (c), (n)))

And we don't? Look at bits/string2.h...
I would say with bits/string*.h exactly the opposite is needed, we need to
check whether the glibc optimizations are still optimizations or whether gcc
does better job (in many cases it does). In the latter case, such code
should be !__GNUC_PREREQ(3,0)'ed.

	Jakub


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