Subject: Re: kern/13369: gcc inlines memcpy(3)
To: Oleg Polianski <Oleg.Polianski@clear.co.nz>
From: Richard Earnshaw <rearnsha@arm.com>
List: netbsd-bugs
Date: 07/05/2001 17:42:01
> Manuel Bouyer <bouyer@antioche.lip6.fr> writes:
>
> There is a special option, `-fno-builtin', that prevents gcc from
> recognizing and inlining of well known functions like `memcpy', `memcmp' and
> some other (math) functions. Plese consult `info gcc' for more information.
This PR has nothing to do with gcc inlining memcpy. memcpy has undefined
behaviour when source and dest regions overlap, whether it is inlined or
left as a function. The problem is that bcopy is defined in terms of
memcpy when it should be defined in terms of memmove.