====== Known issues ====== ===== gcc-ia16 ===== * In general, if you run into a compiler error or miscompilation, try annotating the function with ''%%__attribute__((noinline, optimize("-O0"))) %%'' as a workaround. * gcc-ia16's handling of far pointers is considered experimental. Caveat emptor. * gcc-ia16's handling of DS != SS (wwitch target) is pretty buggy. It works for simple code, but complex pointer operations may lead to bugs. Again, caveat emptor. * The optimization levels ''%%-O0%%'', ''%%-O2%%'' and ''%%-Os%%'' are most stable (roughly in that order). ==== Bug: 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 [[https://github.com/tkchia/gcc-ia16/issues/120|known issue]], with no ETA for a fix. One can work around this by annotating the affected function to be compiled without optimizations. In particular, one can create a separate function that //only// acts as a wrapper for the function call: __attribute__((noinline, optimize("-O0"))) // https://github.com/tkchia/gcc-ia16/issues/120 void call_to_my_function_table(uint8_t index) { my_function_table[index](); } ==== Issue: wwitch target and interrupt handlers ==== The wwitch target does not support relocation; as such, far functions (which interrupt handlers have to be) cannot be created in sections other than the default text section. This can be most easily achieved by building with ''-fno-function-sections'' in CFLAGS.