When ppc machine code is used, this program won't terminate:
int do_work = 1, rounds;
void work() { while (do_work) { rounds++; } }
int main() { for (int i = 0; i < 5; i++) Thread.thread_create (work); sleep (10); do_work = 0; sleep (1); werror ("rounds: %d\n", rounds); }
The reason is that it uses OPCODE_INLINE_BRANCH and doesn't generate the appropriate calls to check_threads_etc() on backward jumps after branch opcodes. (Normally the opcodes do that themselves since they have the address to jump to.)