This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/10946] New: sibcall optimization does not call directly to sibling
- From: "pinskia at physics dot uc dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 May 2003 01:56:18 -0000
- Subject: [Bug target/10946] New: sibcall optimization does not call directly to sibling
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10946
Summary: sibcall optimization does not call directly to sibling
Product: gcc
Version: 3.4
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: target
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: pinskia@physics.uc.edu
CC: gcc-bugs@gcc.gnu.org
GCC build triplet: powerpc-apple-darwin6.6
GCC host triplet: powerpc-apple-darwin6.6
GCC target triplet: powerpc-apple-darwin6.6
compile with -O3 -static or -O3 -mdynamic-no-pic:
int f(int i);
int g(int i, int j)
{
if(i)
return f(i);
else
return j*2*j;
}
Asm:
_g:
cmpwi cr0,r3,0
bne- cr0,L5
mullw r0,r4,r4
slwi r3,r0,1
blr
L5:
b _f
The better way is to do this and not to have an extra branch:
_g:
cmpwi cr0,r3,0
bne- cr0,_f
mullw r0,r4,r4
slwi r3,r0,1
blr
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.