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]

Re: An optimization bug in egcs 1.0.2?


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~


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