I have set the -mshort-calls
flag which is documented to replace the 4 byte long CALL
instruction with the 2 byte long RCALL
instruction when possible to save flash space and and cycles...
-mshort-calls
Assume that RJMP and RCALL can target the whole program memory.
This option is used internally for multilib selection. It is not an optimization option, and you don’t need to set it by hand.
https://gcc.gnu.org/onlinedocs/gcc/AVR-Options.html#index-mshort-calls
...and it set in Atmel Studio here...
Unfortunately the compiler is still using full CALL
instructions even for a call that is only 2 bytes away...
...
35f6: 0e 94 fd 1a call 0x35fa ; 0x35fa
35fa: f8 94 cli
...
What am I doing wrong?