This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

egcs-2.93.22 creates spurious local variables


This is linux on i586.

The following tiny program has egcs-2.93.{19,20,21,22} creating 12 bytes of
space for completely unused variables on the stack. egcs-1.1.2 doesn't. The 
program and assembler outputs follow. I have no earlier snapshots at hand,
so this could be an old problem.

I consider this a performance regression, as there are cases where stack
space is scarce (i.e., the Linux kernel has a very limited stack!)

The files below where compiled with -O2 -fomit-frame-pointer.

tst()
{
   f();
}
	.file	"tst.c"
	.version	"01.01"
gcc2_compiled.:
.text
	.align 4
.globl tst
	.type	 tst,@function
tst:
	call f
	ret
.Lfe1:
	.size	 tst,.Lfe1-tst
	.ident	"GCC: (GNU) egcs-2.91.66 19990314 (egcs-1.1.2 release)"
	.file	"tst.c"
	.version	"01.01"
gcc2_compiled.:
.text
	.align 4
.globl tst
	.type	 tst,@function
tst:
	subl $12,%esp
	call f
	addl $12,%esp
	ret
.Lfe1:
	.size	 tst,.Lfe1-tst
	.ident	"GCC: (GNU) egcs-2.93.22 19990517 (gcc2 ss-980929 experimental)"
-- 
Horst von Brand                             vonbrand@sleipnir.valparaiso.cl
Casilla 9G, Viņa del Mar, Chile                               +56 32 672616

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]