https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114490
--- Comment #3 from Kang-Che Sung <Explorer09 at gmail dot com> --- (In reply to Andrew Pinski from comment #2) > > Basically if you are shifting by 0, then the CF bit never changes from the > previous and this can't be done. > > So the comment in the backend is correct and there is no way to remove the > test (unless you know ch can't be 0). What if I had the CF cleared to 0 already before the shift? Even when the flags don't change when the value in the CL register is zero, if I had the flags in a known state, the optimization can still be done. And my suggested 'my_isxdigit_2' code worked before I know the caveat of the shift instructions... ("xorl %eax, %eax" -> CF = SF = 0)