http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50329
Bug #: 50329
Summary: [PowerPC] Unnecessary stack frame set up
Classification: Unclassified
Product: gcc
Version: 4.6.2
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: target
AssignedTo: [email protected]
ReportedBy: [email protected]
Target: powerpc-eabi-gcc
Created attachment 25229
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25229
Sample code.
Compiling the attached file with
powerpc-eabi-gcc -O3 -S test.c
yields:
.file "test.c"
.section ".text"
.align 2
.globl a
.type a, @function
a:
stwu 1,-536(1)
lis 9,0x1234
lis 0,0x8000
ori 9,9,22136
stw 0,0(9)
addi 1,1,536
blr
.size a, .-a
.ident "GCC: (GNU) 4.6.2 20110819 (prerelease)"
This looks pretty good except that a stack frame is set up and teared down.
In case you use the structure definition for memory mapped devices on embedded
systems, then it would be a great deal to save stack space.