Hi,
I've previously posted my question in another TI forum. I'd like to move it to here because I think it's best suited here. The link is:
http://e2e.ti.com/support/microcontrollers/msp430/f/166/t/295893.aspx
Summarising the question, I expected that the compiler would optimize my code to an assembly XOR, removing the function call and pointer indirection, that I assume to be predictable. I have a sample C code (that just toggles some LEDs) and the disassembly to show what I get. I'm using level 4 optimization, and level 5 for speed, on CCS 5.4 compiler v4.1.5, compiling to a MSP430FG4618.
I tried using const and inline as much as I could, and tried some advanced compiler options, but the results are always the same.
I think that the compiler can't optimize the calls because I use references to the functions I want to inline. Is that true? Does someone has a point on that?
Thanks for any help!