sdcc 4.2.0
sdcc -mmcs51 --opt-code-size --fverbose-asm test.c
#pragma callee_saves foo,bar
static void foo() {}
static void bar() {}
int main() {
unsigned char cnt=123;
do {
foo();
bar();
} while(--cnt);
return 0;
}
got expected result
00101$:
; test.c:10: foo();
lcall _foo
; test.c:11: bar();
lcall _bar
; test.c:12: } while(--cnt);
djnz r7,00101$
Issue is that following pragmas (with spaces) silently ignored/selectively used:
#pragma callee_saves foo, bar
#pragma callee_saves foo ,bar
#pragma callee_saves foo , bar
This is due to setParseWithComma not ignoring white spaces next to the comma, i.e.
#pragma callee_saves foo , baris parsed as applying to "foo " and " bar". I'm not sure if for the other uses of setParseWithComma there would be a problem if white space near the comma was skipped (it is also used in parsing options), but guess not.