I'm not sure I understand the question. The first one about detecting if x is odd or even is usually what the compiler will optimize the more common (x%2) == 0 to.
Other than that, these are things that you have to do yourself. You can't call compiler.setMySeventhBit();
If you need to be able to flip and check bits, you have to do it yourself.