# New Ticket Created by bulk88
# Please include the string: [perl #115822]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=115822 >
This is a bug report for perl from bul...@hotmail.com,
generated with the help of perlbug 1.39 running under perl 5.17.6.
-----------------------------------------------------------------
[Please describe your issue here]
See attached patch.
[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
category=core
severity=low
---
Site configuration information for perl 5.17.6:
Configured by Owner at Sat Nov 17 12:20:28 2012.
Summary of my perl5 (revision 5 version 17 subversion 6 patch blead
2012-11-17.13:10:59 7d4ee4b3ab7a3ef2c4675f2b4dc93f1e6ede7194
v5.17.5-513-g7d4ee4b) configuration:
Snapshot of: 7d4ee4b3ab7a3ef2c4675f2b4dc93f1e6ede7194
Platform:
osname=MSWin32, osvers=5.1, archname=MSWin32-x86-multi-thread
uname=''
config_args='undef'
hint=recommended, useposix=true, d_sigaction=undef
useithreads=define, usemultiplicity=define
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=undef, use64bitall=undef, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cl', ccflags ='-nologo -GF -W3 -MD -Zi -DNDEBUG -O1 -GL -G7
-arch:SSE2 -DWIN32 -D_CONSOLE -DNO_STRICT -DPERL_TEXTMODE_SCRIPTS
-DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO
-D_USE_32BIT_TIME_T',
optimize='-MD -Zi -DNDEBUG -O1 -GL -G7 -arch:SSE2',
cppflags='-DWIN32'
ccversion='13.10.6030', gccversion='', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=8
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64',
lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='link', ldflags ='-nologo -nodefaultlib -debug -opt:ref,icf
-ltcg -libpath:"c:\perl517\lib\CORE" -machine:x86'
libpth="C:\Program Files\Microsoft Visual Studio .NET 2003\VC7\lib"
libs=oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib
netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib
odbc32.lib odbccp32.lib comctl32.lib msvcrt.lib
perllibs=oldnames.lib kernel32.lib user32.lib gdi32.lib
winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib
oleaut32.lib netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib
version.lib odbc32.lib odbccp32.lib comctl32.lib msvcrt.lib
libc=msvcrt.lib, so=dll, useshrplib=true, libperl=perl517.lib
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug
-opt:ref,icf -ltcg -libpath:"c:\perl517\lib\CORE" -machine:x86'
Locally applied patches:
---
@INC for perl 5.17.6:
C:/perl517/site/lib
C:/perl517/lib
.
---
Environment for perl 5.17.6:
HOME (unset)
LANG (unset)
LANGUAGE (unset)
LD_LIBRARY_PATH (unset)
LOGDIR (unset)
PATH=C:\perl517\bin;C:\Program Files\Microsoft Visual Studio .NET
2003\Common7\IDE;C:\Program Files\Microsoft Visual Studio .NET
2003\VC7\BIN;C:\Program Files\Microsoft Visual Studio .NET
2003\Common7\Tools;C:\Program Files\Microsoft Visual Studio .NET
2003\Common7\Tools\bin\prerelease;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS \system32\wbem;
PERL_BADLANG (unset)
SHELL (unset)
[
0001-reduce-scope-of-a-var-in-save_clearsv.patch 1K ]
>From 3aa90d4131634f40701a77f00c7b1950d3dd2666 Mon Sep 17 00:00:00 2001
From: Daniel Dragan <bul
...@hotmail.com>
Date: Sun, 18 Nov 2012 21:16:39 -0500
Subject: [PATCH] reduce scope of a var in save_clearsv
svp is a pointer to a pad array slice. It is derefed to set a sv flag.
It's optimized scope previous extended past the savestack_grow call. By
moving the flag setting before any calls in save_clearsv, svp does not have
to be carried across any calls. On some platforms there will be a benefit
(args transfered in vol regs for example, AMD64 Win64), on others none
since it will be reread from the stack after any child call anyway. I
assume the SvPADSTALE_off flag will have no effect on the panic croak.
After this commit, the only auto var carried through a call is
offset_shifted (and unavoidably my_perl).
I saw a drop in the size of save_clearsv from 0x5A to 0x58. The saving
and use of 1 nonvol reg on x86 32 bit VC 2003 was reduced, total stack
frame reduced by 1 pointer, since VC 2003 read svp off the stack only
once at the start of save_clearsv and kept it in a nonvol reg for the rest
of this func's body.
---
scope.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/scope.c b/scope.c
index 8b82381..67025cf 100644
--- a/scope.c
+++ b/scope.c
@@ -522,13 +522,13 @@ Perl_save_clearsv(pTHX_ SV **svp)
PERL_ARGS_ASSERT_SAVE_CLEARSV;
ASSERT_CURPAD_ACTIVE("save_clearsv");
+ SvPADSTALE_off(*svp); /* mark lexical as active */
if ((offset_shifted >> SAVE_TIGHT_SHIFT) != offset)
Perl_croak(aTHX_ "panic: pad offset %"UVuf" out of range (%p-%p)",
offset, svp, PL_curpad);
SSCHECK(1);
SSPUSHUV(offset_shifted | SAVEt_CLEARSV);
- SvPADSTALE_off(*svp); /* mark lexical as active */
}
void
--
1.7.9.msysgit.0