Using your suggestion
avr-gcc -Os -Q --help=optimizer seems to show that all the inlining options are actually enabled with
-Os, but with
-O2 they are actually not enabled (
-finline-functions is disabled which disables the others I believe). But you are right in practice, when I looked at the disassembly, there were functions not inlined when I thought they should have been… strange.
As for the bug, it was in the version of Avril that I pushed to my own github account back when I did work on the Midipal. So if you used my avril code then you would have the bug. It’s easy to check: just make sure you don’t have a line like
uint8_t msb = lowByte(x) in the function. (Side note: when you use a properly named function rather than
x & 0xff the bug becomes immediately obvious… unfortunately I did not think to check for bugs in code that I wrote a year ago )