https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64309
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |missed-optimization Status|UNCONFIRMED |NEW Last reconfirmed| |2014-12-15 Component|rtl-optimization |middle-end Ever confirmed|0 |1 --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- Confirmed. Sth like (simplify (ne (bit_and (lshift integer_onep @0) integer_onep) integer_zerop) (eq @0 { build_zero_cst (TREE_TYPE (@0)); }) with eventually also covering if ((1 & (1<< n)) == 0) -> if (n & 1 == 0) You can extend this to cover the other cases you mention.