[Bug optimization/11781] superfluous jumps generated

anton at a0 dot complang dot tuwien dot ac dot at gcc-bugzilla@gcc.gnu.org
Wed Aug 13 14:07:00 GMT 2003


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11781



------- Additional Comments From anton at a0 dot complang dot tuwien dot ac dot at  2003-08-13 14:07 -------
Subject: Re:  superfluous jumps generated

pinskia at gcc dot gnu dot org wrote:
> Can you try the mainline (this question might have got missed after Falk asked his 
> question) or a 3.4 snapshot?

Ok, I have tried it with the snapshot gcc-3.4-20030806, and this
totally superfluous jump goes away.

I have also tried adding -fno-reorder-blocks, resulting in the command
line

/usr/local/src/gcc-3.4-20030806-build/gcc/xgcc -B /usr/local/src/gcc-3.4-20030806-build/gcc/ -I./../arch/386 -I. -Wall -O2 -fomit-frame-pointer -fforce-addr -fforce-mem -march=pentium -DHAVE_CONFIG_H -DDEFAULTPATH=\".:/usr/local/lib/gforth/site-forth:/usr/local/share/gforth/site-forth:/usr/local/lib/gforth/0.6.1:/usr/local/share/gforth/0.6.1\" -fno-gcse -fno-strict-aliasing -fno-crossjumping -fno-defer-pop -fcaller-saves -fno-inline -fno-reorder-blocks -o engine-fast.s -S ./engine-fast.i

As a result, gcc performs some pretty dumb cross-jumping again
(despite -fno-crossjumping):

.L1205:
	jmp	*%eax
...
.L661:
.L20:
	movl	636(%esp), %esi
	movl	(%ebp), %edx
	movl	4(%ebp), %eax
	addl	$4, %edi
	addl	$8, %ebp
	testl	%esi, %esi
	jne	.L973
	movl	644(%esp), %ebx
	leal	4(%edx), %ebp
	addl	%eax, %ebx
	movl	%ebx, 644(%esp)
	movl	(%edi), %edx
	movl	%edx, 636(%esp)
	movl	-4(%ebp), %eax
	jmp	.L1205
.L973:
	movl	(%edi), %ecx
	addl	$4, %ebp
	movl	%ecx, 636(%esp)
.L341:
#APP
	#question_branch_lp_plus_store_number
#NO_APP
	movl	-4(%ebp), %eax
	jmp	.L1205
.L662:

Note that the code at .L1205 is shorter than the jumps to .L1205.

This is essentially the same problem that was reported in PR 7953 and
PR 8092.  Should I create a new bug report?

- anton



More information about the Gcc-bugs mailing list