It looks like the JIT-generated code conflicts with gcc generated code w.r.t. usage of callee-saved registers. The first hurdle is that when
comvec, the latter clobbers
p->R = R; assignment segfaults because the code in
xec() to compute
%r31 that has been clobbered.
I have fixed that with a wrapper that saves/restores all callee-saved registers around a call to
comvec. The next hurdle after that is that
R.MP seems to be clobbered when we return from the jitted code, so the next time
MP is used it crashes.
ATTN: @Yaroslav Kolomiiets