------- Additional Comments From rearnsha at gcc dot gnu dot org 2005-02-25 02:04 ------- It's hard to be completely sure what's wrong here, but something *very* suspcision appears near original source line 2669. The good code (on ARM) contains:
.L1706: .LBB453: ldr r3, [r6, #4] .LBE453: .LBB454: add r3, r3, #2 str r3, [r6, #4] .LBE454: mov r0, r5 mov r1, r6 bl Perl_save_freesv but the bad code has .L1705: .LBB457: ldr r3, [r6, #4] add r3, r3, #1 str r3, [r6, #4] .LBE457: mov r0, r5 mov r1, r6 bl Perl_save_freesv b .L1665 Note that in the second case r3 is only incremented by 1 not 2. This seems to have come from the following pre-processed sequence: cx->cx_u.cx_blk.blk_u.blku_sub.cv = cv; cx->cx_u.cx_blk.blk_u.blku_sub.o lddepth = ((XPVCV*)(cv)->sv_any)->xcv_depth; cx->cx_u.cx_blk.blk_u.blku_sub.hasa rgs = hasargs; if (!((XPVCV*)(cv)->sv_any)->xcv_depth) { (void)({ SV *_sv = (SV* )(cv); if (_sv) (++(_sv)->sv_refcnt); _sv; }); (void)({ SV *_sv = (SV*)(cv); if (_sv) (++(_sv)->sv_refcnt); _sv; }); Perl_save_freesv(my_perl, (SV*)(cv)); } cx- >cx_u.cx_blk.blk_u.blku_sub.lval = (my_perl->Top)->op_private & (128|4);; Note the double increment of sv->sv_refcnt. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16152