https://gcc.gnu.org/bugzilla/show_bug.cgi?id=35591
--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> --- Sounds interesting. I'm planning to switch default counter type for string routines to Top N. That would allow such transformations. Do you have any interesting benchmark where one can see a speed gap benefiting from the optimization?