(out-of-band) performance with gcc3

Konstantin Popov kost at sics.se
Thu Jan 22 10:45:34 CET 2004


> Attached are the results from Mandrake 9.2
> k
> 
> gcc 2.96:
[ ]

> 
> gcc 3.3.1:
[ ]

The "vanilla" 2.95.3 and 3.3.2 produce similar, but not identical
results (attached). So, the example does illustrate the issue.


gcc 2.95.3

	.file	"foo.cc"
	.version	"01.01"
# GNU C++ version 2.95.3 20010315 (release) (i686-pc-linux-gnu) compiled by GNU C version 2.95.3 20010315 (release).
# options passed:  -O3 -fomit-frame-pointer -fverbose-asm
# options enabled:  -fdefer-pop -fomit-frame-pointer -fcse-follow-jumps
# -fcse-skip-blocks -fexpensive-optimizations -fthread-jumps
# -fstrength-reduce -fpeephole -fforce-mem -ffunction-cse
# -finline-functions -finline -fkeep-static-consts -fcaller-saves
# -fpcc-struct-return -fgcse -frerun-cse-after-loop -frerun-loop-opt
# -fschedule-insns2 -fexceptions -fcommon -fverbose-asm -fgnu-linker
# -fregmove -foptimize-register-move -fargument-alias -fident -m80387
# -mhard-float -mno-soft-float -mieee-fp -mfp-ret-in-387
# -mschedule-prologue -mcpu=pentiumpro -march=pentium

gcc2_compiled.:
.globl counter
.data
	.align 4
	.type	 counter, at object
	.size	 counter,4
counter:
	.long 0
.text
	.align 4
.globl foo__FPPv
	.type	 foo__FPPv, at function
foo__FPPv:
.LFB1:
	movl 4(%esp),%eax
	testl %eax,%eax
	jne .L3
	movl $.L4,program
	movl $.L5,program+4
	ret
	.p2align 4,,7
.L3:
	jmp *(%eax)
	.p2align 4,,7
.L4:
	addl $3,counter
	addl $4,%eax
	jmp *(%eax)
	.p2align 4,,7
.L5:
	addl $5,counter
	addl $4,%eax
	jmp *(%eax)
.LFE1:
.Lfe1:
	.size	 foo__FPPv,.Lfe1-foo__FPPv
.globl program
.bss
	.align 4
	.type	 program, at object
	.size	 program,8
program:
	.zero	8

.section	.eh_frame,"aw", at progbits
__FRAME_BEGIN__:
	.4byte	.LLCIE1
.LSCIE1:
	.4byte	0x0
	.byte	0x1
	.byte	0x0
	.byte	0x1
	.byte	0x7c
	.byte	0x8
	.byte	0xc
	.byte	0x4
	.byte	0x4
	.byte	0x88
	.byte	0x1
	.align 4
.LECIE1:
	.set	.LLCIE1,.LECIE1-.LSCIE1
	.4byte	.LLFDE1
.LSFDE1:
	.4byte	.LSFDE1-__FRAME_BEGIN__
	.4byte	.LFB1
	.4byte	.LFE1-.LFB1
	.align 4
.LEFDE1:
	.set	.LLFDE1,.LEFDE1-.LSFDE1
	.ident	"GCC: (GNU) 2.95.3 20010315 (release)"


gcc 3.3.2

	.file	"foo.cc"
# GNU C++ version 3.3.2 (i686-pc-linux-gnu)
#	compiled by GNU C version 3.3.2.
# GGC heuristics: --param ggc-min-expand=64 --param ggc-min-heapsize=64260
# options passed:  -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=2
# -D_GNU_SOURCE -D__GNUG__=3 -auxbase-strip -O3 -fomit-frame-pointer
# -fverbose-asm
# options enabled:  -fdefer-pop -fomit-frame-pointer
# -foptimize-sibling-calls -fcse-follow-jumps -fcse-skip-blocks
# -fexpensive-optimizations -fthread-jumps -fstrength-reduce -fpeephole
# -fforce-mem -ffunction-cse -fkeep-static-consts -fcaller-saves
# -fpcc-struct-return -fgcse -fgcse-lm -fgcse-sm -floop-optimize
# -fcrossjumping -fif-conversion -fif-conversion2 -frerun-cse-after-loop
# -frerun-loop-opt -fdelete-null-pointer-checks -fschedule-insns2
# -fsched-interblock -fsched-spec -fbranch-count-reg -fexceptions
# -freorder-blocks -freorder-functions -frename-registers -fcprop-registers
# -fcommon -fverbose-asm -fgnu-linker -fregmove -foptimize-register-move
# -fargument-alias -fstrict-aliasing -fmerge-constants
# -fzero-initialized-in-bss -fident -fpeephole2 -fguess-branch-probability
# -fmath-errno -ftrapping-math -m80387 -mhard-float -mno-soft-float
# -mieee-fp -mfp-ret-in-387 -maccumulate-outgoing-args -mcpu=pentiumpro
# -march=i386

.globl program
	.bss
	.align 4
	.type	program, @object
	.size	program, 8
program:
	.zero	8
.globl counter
	.align 4
	.type	counter, @object
	.size	counter, 4
counter:
	.zero	4
	.text
	.align 2
	.p2align 4,,15
.globl _Z3fooPPv
	.type	_Z3fooPPv, @function
_Z3fooPPv:
.LFB3:
	movl	4(%esp), %ecx	#  PC,  PC
	testl	%ecx, %ecx	#  PC
	je	.L8
	movl	(%ecx), %edx	# * PC
	movl	counter, %eax	#  counter
	jmp	*%edx
	.p2align 4,,7
.L3:
	addl	$3, %eax
.L7:
	movl	%eax, counter	#  counter
	addl	$4, %ecx	#  PC
	movl	(%ecx), %edx	# * PC
	jmp	*%edx
	.p2align 4,,7
.L4:
	addl	$5, %eax
	jmp	.L7
.L8:
	movl	$.L3, %eax
	movl	$.L4, %edx
	movl	%eax, program	#  program
	movl	%edx, program+4	#  program
	ret
.LFE3:
	.size	_Z3fooPPv, .-_Z3fooPPv
	.ident	"GCC: (GNU) 3.3.2"
-
Please send submissions to hackers at mozart-oz.org
and administriva mail to hackers-request at mozart-oz.org.
The Mozart Oz web site is at http://www.mozart-oz.org/.





More information about the mozart-hackers mailing list