4 ms·
most annoying one: Large model. SDCC v 4.1 or 4.0.4. Place two sequential (do not declare anything between them) uint16 vars in __idata Use both in some math
by dmitrygr 6y ago
most annoying one:
Large model. SDCC v 4.1 or 4.0.4.
Place two sequential (do not declare anything between them) uint16 vars in __idata
Use both in some math statements
Eventually (after 4-5 statements, once compiler has to start spilling intermediates to RAM), on a read access, SDCC will access the first one when you intend to access the second. (emits two unneeded "dec R0" instructions for no reason)
Declaring the vars as "volatile" helps sometimes, but changing code shape sometimes brings the bugs back. not placing two u16s in a row into idata seems to avoid it
- Teknoman117 6y agoAh, I'd been using the small model up to this point, so that's probably why I haven't bumped into this.