Change 35014 by [EMAIL PROTECTED] on 2008/12/04 23:32:09 Integrate: [ 34038] Subject: Re: [PATCH] More COW lvalues From: Reini Urban <[EMAIL PROTECTED]> Message-ID: <[EMAIL PROTECTED]> Date: Mon, 09 Jun 2008 17:15:41 +0200 [ 34039] Strength reduction optimisation seems to spot that a = a + 1; is just a++; so write it as the former, to keep PERL_DEBUG_COW happy.
Affected files ... ... //depot/maint-5.10/perl/regcomp.c#20 integrate ... //depot/maint-5.10/perl/sv.h#7 integrate Differences ... ==== //depot/maint-5.10/perl/regcomp.c#20 (text) ==== Index: perl/regcomp.c --- perl/regcomp.c#19~34707~ 2008-11-03 11:50:31.000000000 -0800 +++ perl/regcomp.c 2008-12-04 15:32:09.000000000 -0800 @@ -5590,13 +5590,13 @@ pv = (I32*)SvGROW(sv_dat, SvCUR(sv_dat) + sizeof(I32)+1); SvCUR_set(sv_dat, SvCUR(sv_dat) + sizeof(I32)); pv[count] = RExC_npar; - SvIVX(sv_dat)++; + SvIV_set(sv_dat, SvIVX(sv_dat) + 1); } } else { (void)SvUPGRADE(sv_dat,SVt_PVNV); sv_setpvn(sv_dat, (char *)&(RExC_npar), sizeof(I32)); SvIOK_on(sv_dat); - SvIVX(sv_dat)= 1; + SvIV_set(sv_dat, 1); } #ifdef DEBUGGING if (!av_store(RExC_paren_name_list, RExC_npar, SvREFCNT_inc(svname))) ==== //depot/maint-5.10/perl/sv.h#7 (text) ==== Index: perl/sv.h --- perl/sv.h#6~35005~ 2008-12-03 17:25:36.000000000 -0800 +++ perl/sv.h 2008-12-04 15:32:09.000000000 -0800 @@ -1412,7 +1412,7 @@ (((XPV*) SvANY(sv))->xpv_len = (val)); } STMT_END #define SvEND_set(sv, val) \ STMT_START { assert(SvTYPE(sv) >= SVt_PV); \ - (SvCUR(sv) = (val) - SvPVX(sv)); } STMT_END + SvCUR_set(sv, (val) - SvPVX(sv)); } STMT_END #define SvPV_renew(sv,n) \ STMT_START { SvLEN_set(sv, n); \ End of Patch.