> BTW maybe we should replace > > 31: /on_failure_jump_loop to 37 > 34: /jump to 9 > > with > > 31: /on_failure_dont_jump_loop to 9 In the mean time the patch below recognizes the above pattern, which gives me code which is safe (it should both always terminate and should never apply the optimization if it's not valid) yet does find the optimization in all the cases where I expected it. Stefan