Xingzhi Pan <vengeance.storm@xxxxxxxxx> writes: > 1. Does gcc compile C bitfields into some intermediate representation (IR)? Yes. > 2. If so, does the optimization happen BEFORE or AFTER the IR? Or both? What optimization in particular? BEFORE or AFTER what? In general, the answer is going to be that optimizations are applied to the IR, so they are applied after the IR is created and before it is converted to assembly code. gcc has bitfield optimizations which apply to both the GIMPLE and the RTL IRs. > 3. Where can I find relevant source code? I already did a find+grep > in gcc-4.4.3/gcc directory but I lack the general knowledge of the > overall structure of gcc so the result didn't help much. I'm not clear what you looking for. > 4. Is there any special flags for this feature? Not clear here either, sorry. You said you wanted "to learn how to optimize bitfield compilation" but I don't know what that means to you. Ian