https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116799
--- Comment #5 from Stefan Schulze Frielinghaus <stefansf at gcc dot gnu.org> --- It looks like we are increasing pat once too often, i.e., the loop body while (pat[0] == '*' && pat < pat_end - 1) pat++; is executed twice instead of only once. Prior loop2, IL looks good to me. If I'm exiting early in unroll_loop_runtime_iterations() in case max_unroll is less or equal to 1, then it also works for me TM. Of course, this has nothing to say for a latent bug.