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 builtin functions used by glibc not available on mips


"H . J . Lu" <hjl@lucon.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[0]);
> >        ++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?


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