https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56352
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |missed-optimization Status|UNCONFIRMED |RESOLVED Known to fail| |8.1.0, 8.5.0 Resolution|--- |DUPLICATE Known to work| |10.1.0, 9.1.0, 9.4.0 --- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- GCC9+ does the correct thing: .L5: movl %ebx, %edi addl $1, %ebx call f(int) cmpl %ebx, %ebp jg .L5 GCC 8.5 had: _9 = b_5(D) <= i_7; _8 = a_4(D) <= i_7; _10 = _8 | _9; This was fixed by r9-104. Note there is some issues with mixing constants and non-constants but that is still recorded in PR 85143. And really this is a dup of bug 85143. *** This bug has been marked as a duplicate of bug 85143 ***