https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107176
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |10.5 Component|c |tree-optimization Keywords| |wrong-code Known to fail| |7.1.0 Ever confirmed|0 |1 Status|UNCONFIRMED |NEW Summary|Wrong code at -O0/-Os on |[10/11/12/13 Regression] |x86_64-pc-linux-gnu |Wrong code at -Os on | |x86_64-pc-linux-gnu Last reconfirmed| |2022-10-06 Known to work| |6.3.0 --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Confirmed. Here is a better testcase: #include <stdio.h> int a; long b; static inline long c(unsigned d) { return d; } static inline void e(int d) { a = d; } int main() { b = 0; for (; b < 1; b = c(b - 90) + 90 + 1) ; e(b >> 2); printf("%d\n", a); if (a != 1073741824) __builtin_abort(); }