This is the mail archive of the
mailing list for the glibc project.
Re: Gcc builtin functions used by glibc not available on mips
- From: Joe Buck <jbuck at synopsys dot COM>
- To: geoffk at geoffk dot org (Geoff Keating)
- Cc: hjl at lucon dot org (H . J . Lu), drepper at redhat dot com,libc-alpha at sources dot redhat dot com (GNU C Library), gcc at gcc dot gnu dot org,echristo at redhat dot com
- Date: Thu, 7 Feb 2002 11:23:04 -0800 (PST)
- Subject: Re: Gcc builtin functions used by glibc not available on mips
"H . J . Lu" <firstname.lastname@example.org> writes:
> > In glibc, there are codes
> > /* Partly clean the `bootstrap_map' structure up. Don't use
> > `memset' since it might not be built in or inlined and we cannot
> > make function calls at this point. Use '__builtin_memset' if we
> > know it is available. */
> > #if __GNUC_PREREQ (2, 96)
> > __builtin_memset (bootstrap_map.l_info, '\0', sizeof (bootstrap_map.l_info));
> > #else
> > for (cnt = 0;
> > cnt < sizeof (bootstrap_map.l_info) / sizeof (bootstrap_map.l_info);
> > ++cnt)
> > bootstrap_map.l_info[cnt] = 0;
> > #endif
Geoffry Keating writes:
> GCC does not promise that __builtin_memset will be inlined. Whether
> it calls memset() can depend on details such as which CPU was selected
> to tune for (eg. Pentium III vs. Pentium 4).
Is builtin_memset really enough of a win over the for loop in this context
that it's even worth messing with this stuff?
Why not just get rid of the ifdef and use the else part always?