------- Comment #3 from fpbeekhof at gmail dot com 2009-03-17 11:13 ------- Subject: Re: generated memcpy causes trouble in assignment
rguenth at gcc dot gnu dot org wrote: > ------- Comment #1 from rguenth at gcc dot gnu dot org 2009-03-17 10:59 > ------- > calling memcpy with exactly overlapping operands is safe (obviously). Thus > this is a bug in valgrind. > > It's not so obvious actually, I find the following text in different places: "If the source and destination overlap, the behavior of memcpy is undefined." I guess this is a line from the standard, so when calling memcpy with exactly overlapping operands, it is not officially safe. Thus, if it is safe in libstd++ then that's nice, but it's not a bug in valgrind. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39480