This is the mail archive of the 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]
Other format: [Raw text]

Re: [PATCH] Replace __bzero with memset

On Mon, 12 Jun 2017, Zack Weinberg wrote:

> > +/* Set memory like memset, but different argument order and no return
> > +   value required.  Also only integer caller-saves may be used.  */
> >  void
> >  __aeabi_memclr (void *dest, size_t n)
> >  {
> > -  __bzero (dest, n);
> > +  memset (dest, 0, n);
> >  }
> It's a pre-existing condition, so it shouldn't hold up your patch, but
> this comment concerns me; there is no guarantee that memset will avoid
> using FP or vector registers.  The existing arm/memset.S *doesn't*,
> but it doesn't look like it's all that fine-tuned (compare
> arm/armv7/multiarch/memcpy_impl.S).

__aeabi_memcpy* are (in the multiarch case) aliased to __memcpy_arm to 
avoid such issues.  (There is still an issue for the dynamic linker, see 
bug 15792.  Even with the dynamic linker built to use only core registers 
there might be issues with e.g. interposed malloc called from the dynamic 
linker, unless all relevant registers are saved and restored.)

Joseph S. Myers

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