Simplify double-nextstate optimisation

Executing two nextstate ops in a row is equivalent to executing just
the second, so the peephole optimiser eliminates one of them.

The double-nextstate optimisation seems to have been written under
the assumption that the current op cannot be elided from the op_next
change, which is untrue, as we have oldop (the previous op in
the chain).

If the current op and the one following it are both nextstate ops,
then the contents of the second are moved over to the first and the
second is nulled.  Then current_op->op_next is adjusted to skip over
the newly-nulled op.

The the next op in the chain, the one that the first nextstate op now
points to, is processed.

The result is that every other nextstate in sequence of three or more
would be elided:

1        <;> nextstate(main 1 -e:1) v ->2
-        <0> ex-const v ->-
-        <0> null v ->-
-        <0> ex-const v ->2
2        <;> nextstate(main 1 -e:1) v:{ ->3
-        <0> ex-const v ->-
-        <0> null v ->-
-        <0> ex-const v ->3
3        <;> nextstate(main 1 -e:1) v:{ ->4
-        <0> ex-const v ->-
-        <0> null v ->-
-        <0> ex-const v ->4
4        <;> nextstate(main 1 -e:1) v:{ ->5

We don’t need to go through the complication of making the first next-
state equivalent to the second.  Just null the first one and adjust
the previous op’s pointer (oldop->op_next) to point to the second one.

Now all consecutive nextstates get nulled except the last:

-        <0> ex-nextstate v ->-
-        <0> ex-const v ->-
-        <0> ex-nextstate v ->-
-        <0> ex-const v ->-
-        <0> ex-nextstate v ->-
-        <0> ex-const v ->-
-        <0> ex-nextstate v ->-
-        <0> ex-const v ->-
-        <0> ex-nextstate v ->1
-        <0> ex-const v ->-
-        <0> ex-nextstate v ->1
-        <0> ex-const v ->1
1        <;> nextstate(main 1 -e:1) v:{ ->2

The only visible difference this makes is in B::Deparse output, but
this changed in 5.14 when the optimisation was first introduced, so I
think changing it again is acceptable:

$ perl5.12.4 -MO=Deparse -e 'use strict; 0; use warnings; 0'
use strict 'refs';
'???';
use warnings;
'???';
-e syntax OK

$ perl5.14.4 -MO=Deparse -e 'use strict; 0; use warnings; 0'
use warnings;
use strict 'refs';
'???';
;
'???';
-e syntax OK

$ ./perl -Ilib -MO=Deparse -e 'use strict; 0; use warnings; 0'
;
'???';
use warnings;
use strict;
'???';
-e syntax OK
Change OA_DANGEROUS description in regen/opcode*

‘Has side effects’ can be misleading.  The OA_DANGEROUS flag is only
used by the common-vars search that checks to see whether it is possi-
ble to skip making temporary copies.

We have to make copies in cases like this:

   ($a,$b) = func();

because func() could return ($b,$a).

If any op on either side is marked OA_DANGEROUS and not handled spe-
cially in op.c:S_aassign_scommon_vars, then it is assumed it could
return a scalar that is also elsewhere in the list, so a temp copy
is needed.

(I think some of the existing ops with this flag could drop it.)