If long double math functions do not work, drop uselongdouble.

This moves a earlier version of the test from the freebsd hints
to Configure, thus stopping also any other platforms that have
lacking longdouble implementations.

The test is not comprehensive (not all long double interfaces are tested),
but it covers some of the most common ones.

The earlier test was actually wrong, so no FreeBSD could ever pass.
Sorry, FreeBSD.
Revert "sisyphus thinks the test value is simply wrong here."

This reverts commit 5399a05dbb94d8e0c2a0ea2b588ff80ad23f2093.

(sisyphus thinks the bug is actually in ppc64 linux exp())
Special case exp(1) for ppc64-linux.
[perl #123163] use the original link order unless on os390
repeat.t: Correct comment

When a57276195 changed the eq to is(), the comment was not updated.
The test still works.  (I tried introducing the bug it was testing
for via SP--, and it failed as expected.)
[perl #123161] Add %B::Op_private::ops_using
Have Deparse use %B::Op_private::ops_using
current_sub.t: Test sub(){__SUB__}

If the constant inlining algorithm changes, we need to make sure not
to break sub(){__SUB__} accidentally.

Sometimes __SUB__ gets optimised to a constant.  Constant inlining
searches the op tree for constants.  Currently we are saved by the
fact that the search happens before the peephole optimizer does the
conversion.
add filename handling to xs handshake

- this improves the error message on ABI incompatibility, per
  [perl #123136]
- reduce the number of gv_fetchfile calls in newXS over registering many
  XSUBs
- "v" was not stripped from PERL_API_VERSION_STRING since string
  "vX.XX.X\0", a typical version number is 8 bytes long, and aligned to
  4/8 by most compilers in an image. A double digit maint release is
  extremely unlikely.
- newXS_deffile saves on machine code in bootstrap functions by not passing
  arg filename
- move newXS to where the rest of the newXS*()s live
- move the "no address" panic closer to the start to get it out of the way
  sooner flow wise (it nothing to do with var gv or cv)
- move CvANON_on to not check var name twice
- change die message to use %p, more efficient on 32 ptr/64 IV platforms
  see ML post "about commit "util.c: fix comiler warnings""
- vars cv/xs_spp (stack pointer pointer)/xs_interp exist for inspection by
  a C debugger in an unoptimized build
sub(){__SUB__} under -d, sub{eval"";__SUB__}

The peephole optimiser changes __SUB__ to a constant if the sub is not
clonable.  All anonymous subs are clonable under the debugger, but
they are not marked as such until after the peephole optimiser runs.

If a sub is clonable, then it undergoes a second search through the
op tree (op_const_sv) to see if it is inlinable.  Trying to make
sub(){__SUB__} inlinable results in some sort of memory corruption,
in which it presumably points to a freed SV that get reused for some-
thing else:

$ PERL5DB='sub DB::DB{}' ./perl -dIlib  -lE 'BEGIN{*f = sub(){__SUB__}}; print f; print \&f'
*IO::File::AUTOLOAD
CODE(0x7fef62035760)

(Both lines should show the same thing.)

The same clonability applies to subs containing a string eval.  The
sub is not marked clonable yet when __SUB__ becomes a constant, so it
ends up referring to the closure prototype:

$ ./perl -Ilib  -lE 'BEGIN{*f = sub(){eval""; __SUB__}}; print f; print \&f; f->()'
CODE(0x7fe8c2036fe8)
CODE(0x7fe8c2031730)
Closure prototype called at -e line 1.

When turning __SUB__ into a constant, we need to check the same con-
dition (PL_cv_has_eval || PL_perldb; see pad_tidy) that would make a
sub clonable.
Make sub(){$outer_lexical} return a copy each time

We don’t actually stop in from being inlined, but simply mark the
inlined value as PADTMP, so it gets copied in lvalue context.
Preserve :method in sub:method(){$outer_lex}

When we turn such a sub into a constant, we need to preserve the
attribute, since it changes behaviour.
Don’t turn sub:CustomAttr(){$outer_lex} into a const

We can’t know what the attributes are for, and turning it into a con-
stant discards the attributes.
Update comments about sub(){$x} consting

It no longer has anything to do with constant.pm.
Add new LVALUE flag for pad names

This will be used to record whether a pad entry is used as an lvalue
multiple times.  If so, it cannot be used as a constant.
op.c: Record lvalue use of lexicals

other than where the variable is declared.

This will be used to determine whether my $x; sub(){$x} can make a
constant.  Currently, this becomes a constant even if $x is subse-
quently modified, breaking the closure behaviour (bug #79908).
Don’t attempt to inline my sub (){$outer_var}

$ perl5.18.2 -Ilib  -Mfeature=lexical_subs -e ' my $x; my sub a(){$x}; print a'
The lexical_subs feature is experimental at -e line 1.
Segmentation fault: 11

Same in blead.

When calls to the sub are compiled (the ‘a’ in ‘print a’) the value
of the lexical variable cannot possibly known, because the sub hasn’t
been cloned yet, and all we have is the closure prototype.

A potentially constant closure prototype is marked CvCONST and
cv_const_sv_or_av (called by the code in toke.c that handles bare-
words) thinks that CvCONST means we have a constant XSUB.  Only lexi-
cal subs allow a closure prototype to reach that function.

We shouldn’t mark the closure prototype as CvCONST to begin with.
Because when we do, the ‘constant’ is retrieved from CvXUBANY, which
is a union shared by CvSTART.  Then toke.c does SvREFCNT_inc on
CvSTART, and screws up the op tree.
pad.c:S_cv_clone: Add assertion

This code cannot handle the case where cloning uses an existing
stub, because it creates a new CV via newCONSTSUB.  Cloning into
an existing stub only happens for lexical subs, and the previous
commit prevented them from reaching this code.  Before that we
would have had assertion failures in pp_padcv.
pad.c: Have S_cv_clone_pad return the CV

Currently it is a void function, because it modifies the CV in place.
Shortly it will sometimes return a different CV from the one it was
passed.
pad.c: Move constant closure code

S_cv_clone normally calls S_cv_clone_pad, which takes care of cloning
the pad, surprisingly enough.  Then S_cv_clone checks whether it can
turn a closure into a constant.  That code needs to be moved into
S_cv_clone_pad, because, not only is it pad-related, but to work cor-
rectly it needs to access the outer sub (which S_cv_clone_pad already
fetches for its own use), which future commits will make it do.