This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: An optimization bug in egcs 1.0.2?
- To: "H.J. Lu" <hjl at lucon dot org>
- Subject: Re: An optimization bug in egcs 1.0.2?
- From: Richard Henderson <rth at cygnus dot com>
- Date: Tue, 24 Mar 1998 02:54:45 -0800
- Cc: egcs at cygnus dot com, Ulrich Drepper <drepper at cygnus dot com>
- References: <199803240043.TAA18518@jfc.> <m0yHHxm-00058JC@ocean.lucon.org>
- Reply-To: Richard Henderson <rth at cygnus dot com>
On Mon, Mar 23, 1998 at 04:53:09PM -0800, H.J. Lu wrote:
> It is from the dynamic linker in glibc 2. memcpy is safe there.
> memcpy is used for optimization.
No, memcpy on overlapping objects is wrong.
memcpy (tail, tail + 1,
(void *) _dl_global_scope_end - (void *) tail);
This may happen to work on the particular implementation
of memcpy used on i386, but will fail for others.
r~