[perl #122965] aelemfast in list assignment

I accidentally broke ($_[0],$_[1])=($_[1],$_[0]) in be9de18, which was
only supposed to be a refactoring.  Since it now happens later in the
compilation phase when optimisations like aelemfast have happened, the
search for common vars needs to take aelemfast into account.
silence warning after "Fold join to const or stringify where possible"

VC 2003
op.c(4022) : warning C4244: '=' : conversion from 'unsigned short' to
'char', possible loss of data
move POD in warnings.pm to end of file to reduce module load I/O calls

warnings.pm is the hottest file/takes the most read() calls of any
module during a make all. By moving POD to the end, ~40KB of OS read()
IO was reduced to ~16KB of OS read() IO calls. Also the parser doesn't need
to search for Perl code in the POD further lessining load time because of
the __END__ token. Filed as [perl #122955].
remove excess whitespace from warnings.pm

Some lines end with spaces, remove that, use tabs instead of spaces in code
so the perl code is less bytes to read from disk. This patch saved 183
bytes. Part of [perl #122955].
speed up building with less disk IO pod moves+__END__+misc

In Cwd.pm, dont search for pwd on Win32.

Also trim down the list of makefile suffixes on Win32 so it doesn't try
searching for av.pas and perl.f90 and hash.cbl on disk.

Add __END__ tokens to stop the last read() call on the handle which
returns 0 bytes at EOF.
op.c: Skip priv flags assert if ppaddr changes

because an XS module is probably installing its own ppaddr, in which
case it knows more about the private flags than we do.
Handle aelemfast_lex in S_aassign_common_vars

This was a missed opportunity for optimisation.  Prior to be9de18 it
was optimised, because S_aassign_common_vars was called earlier in
the compilation phase, before the aelemfast optimisation.
aelemfast_lex in aassign_common_vars_aliases_only

S_aassign_common_vars_aliases_only needs to handle aelemfast_lex,
otherwise we miss some rare cases where we have aliased scalars and
elements on both sides of the assignment.
deprecate POSIX::tmpnam

This patch avoids repeating the deprecation warning if the same tmpnam()
call is executed multiple times.
perldelta for cae71c5daa29
threads::shared "$#shared = N" off-by-one error

RT #122950

    my @a : shared;
    $#a = 3;  # actually set it to 4

There was a simple off-by-one error in the XS code that handled the
STORESIZE tie method (confusing the array size and fill, which differ
by 1).

Amazingly, there was no test for it, and no-one had noticed up until now.

Note that this commit causes three tests in object2.t to fail: this
is because fixing the $#shared bug exposed another bug that was being
masked by this one. They will be fixed in the next commit
threads: $#shared = N should destroy

When shrinking a shared array by setting $#shared = N,
any freed elements should trigger destructors if they are objects,
but they weren't.

This commit extends the work done by 7d585d2f3001 (which created tmp
proxys when abandoning elements of arrays and hashes) to the STORESIZE
method, which is what is triggered by $#a assignment (and indirectly by
undef @a).
fix op.c under -DPERL_GLOBAL_STRUCT
fix comment from commit f4eedc6b8c
treat fatal warnings after syntax errors as syntax errors
perldelta for 594b6face91a
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.)
Deparse join("", pos) correctly

I optimised join into stringify if it had a list of one scalar-
returning op.

$ ./perl -Ilib -MO=Deparse -e '$_ = join $foo, $bar'
$_ = "$bar";
-e syntax OK

The problem, though, is that we now create op trees that didn’t happen
before,* and B::Deparse can’t handle them correctly:

$ ./perl -Ilib -MO=Deparse -e '$_ = join $foo, pos'
$_ = "pos($_)";
-e syntax OK

So we need to turn that into:

$_ = join('???', pos);

* Actually, in 5.8 it was possible to interpolate arbitrary expres-
sions after ‘$_[0]->’:

$_ = "\n,rekcah lreP rehtona tsuJ"; sub a{chop}
print "${[bless[]]}[0]->a . reverse $_";

And that, consequently, did not deparse properly.
Fix typo in 4cad5dc8's perldelta for 157fb5a

For: RT # 122981