https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102673
Bug ID: 102673 Summary: [9 Regression] Wrong code with -O due to adjust_cond_for_loop_until_wrap Product: gcc Version: 9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: ibuclaw at gcc dot gnu.org Target Milestone: --- Reduced test, when compiled with -O, optimizes the loop into `return 1;`. --- int main() { for (unsigned a = 0, b = 0; a < 6; a += 1, b += 2) { if (b < a) return 1; } return 0; } --- https://godbolt.org/z/YM7aYrY8v Bisected, and the commit that changed behaviour was the fix for pr84648.