OPTIMIZATIONS
Function
-Onbf
None
None
None
None
This option prevents the Compiler from combining sequences of bitfield assignments containing constants. This simplifies debugging and makes the code more readable.
struct { b0:1; b1:1; b2:1; } bf; void main(void) { bf.b0 = 0; bf.b1 = 0; bf.b2 = 0; }
Without -Onbf (pseudo intermediate code):
BITCLR bf, #7 // all 3 bits (the mask is 7)
// are cleared
With -Onbf (pseudo intermediate code):
BITCLR bf, #1 // clear bit 1 (mask 1)
BITCLR bf, #2 // clear bit 2 (mask 2)
BITCLR bf, #4 // clear bit 3 (mask 4)
-Onbf