https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66348
--- Comment #3 from Sebastiano Vigna <sebastiano.vigna at unimi dot it> --- As an additional information: we printed b->num_lines - 1 - n just before the loop, and everything is fine--we get there with the current value both with -O0 and -O1. But we -O1 we never exit the loop.