I think the p6bool is removed here: 
https://github.com/rakudo/rakudo/blob/605f272881a76f0c5a9e352670a1e61eaa627ca6/src/Perl6/Optimizer.nqp#L1300

As far as I understand, the following code shows the problem at a lower level 
(no differentiation between optimize=(1|2) required -- it happens on all 
levels):

$ ./perl6-m --optimize=off -e 'use nqp; say 
nqp::unless(nqp::p6bool(nqp::iseq_i(42,42)), False)'
True

$ ./perl6-m --optimize=0 -e 'use nqp; say 
nqp::unless(nqp::p6bool(nqp::iseq_i(42,42)), False)'
1

I have no idea how it can be fixed, though. Maybe it's not even feasible to do 
what the comment above the relevant code block promises?

  # Some ops have first boolean arg, and we may be able to get rid of
  # a p6bool if there's already an integer result behind it.

Reply via email to