https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70168
--- Comment #1 from Ulrich Weigand <uweigand at gcc dot gnu.org> --- Created attachment 37925 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=37925&action=edit Patch to add retval vs. newval overlap check This patch fixes the problem for me with the GCC 5 branch. Not fully regression tested yet.