Hi.
In https://software.intel.com/sites/default/files/m/a/1/e/dsohowto.pdf
Ulrich Drepper recommends static jump tables based on label offsets
rather than labels' absolute values in order to minimize relocations.
Drepper's example:
int add (int a, int b) {
static const int offsets[] = {
&&a0-&&a0, &&a1-&&a0, &&a2-&&a0
};
goto *(&&a0 + offsets[b]);
a0:
return a + 0;
a1:
return a + 1;
a2:
return a + 2;
}
This doesn't work on tcc, at least not with the array being `static`
(error: initializer element is not constant).
I guess there isn't an easy fix that would make this work on tinycc's
part (without modifications to the example code)?
Thanks.
Regards,
Petr S.
_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel