https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102872
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Note this does not get optimized at the rtl level on all targets either, e.g. aarch64 we get: tst w0, 65535 and w0, w0, 65535 ccmp w0, 0, 4, eq beq .L3 bl foo