Compilers' Options

Giorgos Keramidas keramida at ceid.upatras.gr
Fri Apr 14 05:26:45 EEST 2000


Vasilis Vasaitis <vvas at hal.csd.auth.gr> writes:

> On Thu, Apr 13, 2000 at 03:14:00PM +0300, Giorgos Keramidas wrote:
> > 
> > Loipon.  Ola kala, as poume oti meta apo ta unrolls, kai ta inlines
> > pou 8a sou kanei auto to pragma, kai kala mou twra tha einai pio
> > kapos to teliko ektelesimo.  As poume oti glitoses kai ligo
> > megethos, bgazontas to frame-pointer, kai glitonontas tis entoles
> > 
> > 	pushl %ebp		<--
> > 	movl %esp,%ebp		<--
> > 	...
> > 	leave			<--
> 
> E oxi kai leave. Opoios xrnsimopoiei tetoies suv8etes evtoles se
> Pentium kai avw 8a eprepe va ektelestei epitopou. O gcc pavtws dev to
> kavei.
> 
> > 	ret

Eeh, emena to kanei.  Gia to parakato function se C, o kodikas pou blepo
sto output tou cc -S exei 'leave' mesa, akoma ki otan balo kai -O3!

	keramida-> cat func.c
	int func (int a, int b, int c)
	{
		return (a - b + c);
	}

	keramida-> cc -S func.c
	.text
	        .p2align 2,0x90
	.globl func
	        .type    func, at function
	func:
	        pushl %ebp
	        movl %esp,%ebp
	        movl 12(%ebp),%eax
	        movl 8(%ebp),%edx
	        subl %eax,%edx
	        movl %edx,%eax
	        addl 16(%ebp),%eax
	        leave
	        ret

Les na me douleuei to gcc mou?  Bebaia na po tin amartia mou, den exo
kai very latest gcc, kathos to -v option mou leei:

	keramida-> gcc -v
	Using builtin specs.
	gcc version 2.95.2 19991024 (release)

Ola auta me to 'leave' pantos den ta kanei otan balo to option
-fomit-frame-pointer, kai an ennoouses auti tin periptosi, exeis ontws
olo to dikio me to meros sou.  Alla auto sinithos den to xrhsimopoiw,
giati akoma kai me 1 register parapano h Intel de sozetai.  Tis leipoun
alloi 25 mexri tous 32, kai auto metrontas *kai* ton %ebp san general
purpose register mazi me tous %e[abcd]x, kai tous %e[sd]i.

Anti8eta, afhnontas ton frame pointer sti thesi tou, etsi kai petaksei
kanena programma core, sinithos mporo me ton gdb na bro ti paizei.
Mallon den ti glitono ti 'leave' telika :/

-- 
Giorgos Keramidas, < keramida @ ceid . upatras . gr >
For my public pgp key: finger keramida at diogenis.ceid.upatras.gr

--
linux-greek-users mailing list -- http://lists.hellug.gr




More information about the Linux-greek-users mailing list