This was taken from t/pmc/iterator.t:
# XXX
# swapping the next two lines breaks JIT/i386
# the reason is the if/unless optimization: When the
# previous opcode sets flags, these are used - but
# there is no check, that the same register is used in the "if".
inc I0
dec I1
if I1, fill
I've taken this comment out of the test file because it's in no way
relevant to Iterator. It needs to be confirmed or rejected. And if it
*is* confirmed, it needs to be added as a test somewhere else.
--
Matt Diephouse
TEMPLATE Parrot_ifunless_x_ic {
/*
* FIXME - the compare prev_op[1] == cur_op[1] should do it
* dec I1
* inc I0
* if I1, boom
*/
if ( P_ARITH && jit_info->prev_op[1] == jit_info->cur_op[1]) {
It's not clear to me from that comment if the text after FIXME explains
that the test does not work or that it was added to do the fix. I
suspect the second - it's the Right Thing to do as far as I can see, and
trying to re-create the bug does not show it up. I swapped those lines
round on the test, and it still passes under -j.
I think maybe this bug is resolved and the FIXME comment should go, but
a comment from someone who's worked on the JIT would be nice.
Jonathan
After chatting with leo on IRC, and observing that this bug can't be
recreated with Parrot today, it appears that the apparent fix really
does fix it. Comment from core.jit removed.
Thanks,
Jonathan