User Tools

Site Tools


wswan:bugs

Known bugs

gcc-ia16

  • In general, gcc-ia16's handling of far pointers is considered experimental. (In a wswan target context, this means all accesses outside of the console's internal RAM.) Caveat emptor.

Miscompilations involving far function pointers

In some cases, when calling pointers from arrays of far function pointers in optimization modes >= -O1, the code will be miscompiled. This is a known issue, with no ETA for a fix.

One can work around this by annotating the affected function to be compiled without optimizations:

__attribute__((optimize("-O0"))) // https://github.com/tkchia/gcc-ia16/issues/120
void call_to_my_function_table(uint8_t index) {
    my_function_table[index]();
}

wswan/bugs.txt · Last modified: 2024/02/18 08:30 by asie