https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105651
--- Comment #13 from Jonathan Wakely <redi at gcc dot gnu.org> --- I think the vast majority of string mutations involve inserting/appending/substituting an unrelated string, so non-overlapping. We can make your change on trunk.