[Bug rtl-optimization/16152] perl-5.8.4 fails to build using gcc-3.3.4 on {ia64,arm,m68k}-linux

rearnsha at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Fri Feb 25 15:02:00 GMT 2005


------- 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



More information about the Gcc-bugs mailing list