Skip Menu |
Report information
Id: 132928
Status: open
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors: bulk88 <bulk88 [at] hotmail.com>
Cc:
AdminCc:

Operating System: (no value)
PatchStatus: (no value)
Severity: low
Type: core
Perl Version: 5.27.9
Fixed In: (no value)

Attachments
0001-remove-regexec.c-non_utf8_target_but_utf8_required-i.patch



From: bulk 88 <bulk88 [...] hotmail.com>
To: "perlbug [...] perl.org" <perlbug [...] perl.org>
Date: Thu, 1 Mar 2018 15:38:58 +0000
Subject: [PATCH] remove regexec.c:non_utf8_target_but_utf8_required indirection var
Download (untitled) / with headers
text/plain 3.4k
This is a bug report for perl from bulk88@hotmail.com, generated with the help of perlbug 1.41 running under perl 5.27.9. ----------------------------------------------------------------- [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.27.9: Configured by Administrator at Tue Jan 30 20:34:30 2018. Summary of my perl5 (revision 5 version 27 subversion 9) configuration: Platform: osname=MSWin32 osvers=5.2.3790 archname=MSWin32-x86-multi-thread uname='' config_args='undef' hint=recommended useposix=true d_sigaction=undef useithreads=define usemultiplicity=define use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n default_inc_excludes_dot=define bincompat5005=undef Compiler: cc='cl' ccflags ='-nologo -GF -W3 -O1 -MD -Zi -DNDEBUG -GL -DWIN32 -D_CONSOLE -DNO_STRICT -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DWIN32_NO_REGISTRY' optimize='-O1 -MD -Zi -DNDEBUG -GL' cppflags='-DWIN32' ccversion='15.00.30729.01' gccversion='' gccosandvers='' intsize=4 longsize=4 ptrsize=4 doublesize=8 byteorder=1234 doublekind=3 d_longlong=undef longlongsize=8 d_longdbl=define longdblsize=8 longdblkind=0 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:\perl\lib\CORE" -machine:x86' libpth="C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\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=perl527.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:\perl\lib\CORE" -machine:x86' --- @INC for perl 5.27.9: lib C:/p527/srcnew/lib --- Environment for perl 5.27.9: CYGWIN=tty HOME (unset) LANG (unset) LANGUAGE (unset) LD_LIBRARY_PATH=/usr/lib/x86:/usr/X11R6/lib LOGDIR (unset) PATH=C:\WINDOWS\system32;C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN;C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin;C:\Perl\bin;C:\WINDOWS;C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE;C:\Program Files (x86)\Git\bin;C:\sp3220\c\bin; PERL_BADLANG (unset) SHELL (unset)

Message body is not shown because sender requested not to inline it.

Date: Fri, 2 Mar 2018 07:07:17 -0700
Subject: Re: [perl #132928] [PATCH] remove regexec.c:non_utf8_target_but_utf8_required indirection var
To: perl5-porters [...] perl.org
From: Karl Williamson <public [...] khwilliamson.com>
Download (untitled) / with headers
text/plain 4.2k
On 03/01/2018 08:39 AM, bulk88 (via RT) wrote: Show quoted text
> # New Ticket Created by bulk88 > # Please include the string: [perl #132928] > # in the subject line of all future correspondence about this issue. > # <URL: https://rt.perl.org/Ticket/Display.html?id=132928 > > > > This is a bug report for perl from bulk88@hotmail.com, > generated with the help of perlbug 1.41 running under perl 5.27.9. > > > ----------------------------------------------------------------- > [Please describe your issue here] > > See attached patch.
I'm trying to understand the point of your patch. It looks like it lowers slightly the size under Windows, but there are compilers, such IIRC as HP's that will generate duplicate copies of this string, so their size will increase, I believe. Show quoted text
> > [Please do not change anything below this line] > ----------------------------------------------------------------- > --- > Flags: > category=core > severity=low > --- > Site configuration information for perl 5.27.9: > > Configured by Administrator at Tue Jan 30 20:34:30 2018. > > Summary of my perl5 (revision 5 version 27 subversion 9) configuration: > > Platform: > osname=MSWin32 > osvers=5.2.3790 > archname=MSWin32-x86-multi-thread > uname='' > config_args='undef' > hint=recommended > useposix=true > d_sigaction=undef > useithreads=define > usemultiplicity=define > use64bitint=undef > use64bitall=undef > uselongdouble=undef > usemymalloc=n > default_inc_excludes_dot=define > bincompat5005=undef > Compiler: > cc='cl' > ccflags ='-nologo -GF -W3 -O1 -MD -Zi -DNDEBUG -GL -DWIN32 > -D_CONSOLE -DNO_STRICT -D_CRT_SECURE_NO_DEPRECATE > -D_CRT_NONSTDC_NO_DEPRECATE -DPERL_TEXTMODE_SCRIPTS > -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DWIN32_NO_REGISTRY' > optimize='-O1 -MD -Zi -DNDEBUG -GL' > cppflags='-DWIN32' > ccversion='15.00.30729.01' > gccversion='' > gccosandvers='' > intsize=4 > longsize=4 > ptrsize=4 > doublesize=8 > byteorder=1234 > doublekind=3 > d_longlong=undef > longlongsize=8 > d_longdbl=define > longdblsize=8 > longdblkind=0 > 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:\perl\lib\CORE" -machine:x86' > libpth="C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\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=perl527.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:\perl\lib\CORE" -machine:x86' > > > --- > @INC for perl 5.27.9: > lib > C:/p527/srcnew/lib > > --- > Environment for perl 5.27.9: > CYGWIN=tty > HOME (unset) > LANG (unset) > LANGUAGE (unset) > LD_LIBRARY_PATH=/usr/lib/x86:/usr/X11R6/lib > LOGDIR (unset) > PATH=C:\WINDOWS\system32;C:\Program Files (x86)\Microsoft Visual > Studio 9.0\VC\BIN;C:\Program Files\Microsoft > SDKs\Windows\v6.0A\bin;C:\Perl\bin;C:\WINDOWS;C:\Program Files > (x86)\Microsoft Visual Studio 9.0\Common7\IDE;C:\Program Files > (x86)\Git\bin;C:\sp3220\c\bin; > PERL_BADLANG (unset) > SHELL (unset) > > > > >
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 1.5k
On Fri, 02 Mar 2018 06:08:06 -0800, public@khwilliamson.com wrote: Show quoted text
> On 03/01/2018 08:39 AM, bulk88 (via RT) wrote:
> > # New Ticket Created by bulk88 > > # Please include the string: [perl #132928] > > # in the subject line of all future correspondence about this issue. > > # <URL: https://rt.perl.org/Ticket/Display.html?id=132928 > > > > > > > This is a bug report for perl from bulk88@hotmail.com, > > generated with the help of perlbug 1.41 running under perl 5.27.9. > > > > > > ----------------------------------------------------------------- > > [Please describe your issue here] > > > > See attached patch.
> > I'm trying to understand the point of your patch. It looks like it > lowers slightly the size under Windows, but there are compilers, such > IIRC as HP's that will generate duplicate copies of this string, so > their size will increase, I believe.
That static char * var with 1 reference wasn't optimized out by VC. I poked around a HPUX SL format perl binary a bit, IDK if it was compiled with acc or gcc, but it looked to me like identical string literals from ONE .o are de-duped but are not deduped across .o boundaries, and libperl is made of multiple .o'es. This patch doesn't solve deduping the string literals on CCs that dont want to, but it did removed the global pointer sized var. Maybe wrong linker/CC flags with perl on HPUX. I know originally per C specification all C double quote literals were stored in RW memory, but I think Perl forces it RO on any OS that has default RW string literals with Configure. -- bulk88 ~ bulk88 at hotmail.com
To: perl5-porters [...] perl.org
Subject: Re: [perl #132928] [PATCH] remove regexec.c:non_utf8_target_but_utf8_required indirection var
From: Zefram <zefram [...] fysh.org>
Date: Fri, 9 Mar 2018 13:06:34 +0000
Download (untitled) / with headers
text/plain 1.2k
bulk88 via RT wrote: Show quoted text
>That static char * var with 1 reference wasn't optimized out by VC.
That's too small a concern to be worth optimising for, especially for something only present in debugging builds. Show quoted text
>This patch doesn't solve deduping the string literals on CCs that dont >want to, but it did removed the global pointer sized var.
Duplication of string literals involves quite a bit more binary size than the occasional pointer variable, and *is* something we optimise for. Some compilers don't merge identical string literals at all; some merge within a compilation unit but not between compilation units; some may merge between compilation units as well. There is some value in lifting this string literal out as a separate named object, even within a single compilation unit, because it's referenced in multiple places. Though for debugging-only code the value is limited. Probably a better approach would be to make the named object an array of char, instead of a pointer to char, as utf8_locale_required[] just above it already is. This means that only a single instance of the string would exist (as at present), but in addition a straightforward compilation wouldn't allocate storage for a pointer to the string. References to the array would compile to point directly to the string. -zefram


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org