This is the mail archive of the gcc@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]

PPC optimizing question


Can somebody explain me why egcs saves the LR
register and not simply does a

li 3,2
b O2 ?

for a simple void function or if the return
type is compatible i can't see a reason this
wouldn't be possible.


gcc -S -O2 -fomit-frame-pointer test4.c

typedef unsigned long ULONG ;

//register ULONG pc __asm("r11");


void	O2(int			Size)
{
}

void	O3(void)
{
  O2(2);
}


O2:
	blr

O3:
	stwu 1,-16(1)
	mflr 0
	stw 0,20(1)
	li 3,2
	bl O2
	lwz 0,20(1)
	mtlr 0
	la 1,16(1)
	blr


---
Ralph Schmidt,laire@popmail.owl.de(private),NextMail welcome


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