https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102794
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aldyh at gcc dot gnu.org --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Jump threading really messes up the loop here ... about to thread: path: 4 -> 6, 6 -> 7, 7 -> 3, just threaded: path: 4 -> 9, 6 -> 7, 7 -> 3, I don't know what else to say. Maybe move ethread after evpr? Note with -fno-thread-jumps, evpr is able to figure out the induction variable goes from [-100, -1] . It does look like jump threading is full on messing up how induction variable detection works; we get two a = a +1; statement after the jump threading improvements. Maybe there is another bug about that case already.