Unable to bootstrap gcc snapshot of 20001211 on Dynix/ptx

Joseph S. Myers jsm28@cam.ac.uk
Mon Dec 18 17:03:00 GMT 2000


On Mon, 18 Dec 2000, Joe Buck wrote:

> Ouch.  I was going to suggest just getting rid of the bcopy calls
> and rely on libiberty to provide memcpy and memmove for systems that
> lack it.  But libiberty appears to assume that it can implement memmove, on
> systems that don't have it, as a wrapper around bcopy.

We want to get rid of bcopy calls anyway.

The following memmove implementation is from sh-utils-2.0/lib/memmove.c -
perhaps it could replace the one in libiberty?

/* memmove.c -- copy memory.
   Copy LENGTH bytes from SOURCE to DEST.  Does not null-terminate.
   In the public domain.
   By David MacKenzie <djm@gnu.ai.mit.edu>.  */

#if HAVE_CONFIG_H
# include <config.h>
#endif

void *
memmove (dest, source, length)
     char *dest;
     const char *source;
     unsigned length;
{
  char *d0 = dest;
  if (source < dest)
    /* Moving from low mem to hi mem; start at end.  */
    for (source += length, dest += length; length; --length)
      *--dest = *--source;
  else if (source != dest)
    {
      /* Moving from hi mem to low mem; start at beginning.  */
      for (; length; --length)
	*dest++ = *source++;
    }
  return (void *) d0;
}

-- 
Joseph S. Myers
jsm28@cam.ac.uk



More information about the Gcc mailing list