This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/55757] Suboptimal interrupt prologue/epilogue for ARMv7-M (Cortex-M3)
- From: "joey.ye at arm dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 21 Dec 2012 03:32:21 +0000
- Subject: [Bug rtl-optimization/55757] Suboptimal interrupt prologue/epilogue for ARMv7-M (Cortex-M3)
- Auto-submitted: auto-generated
- References: <bug-55757-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55757
--- Comment #5 from Joey Ye <joey.ye at arm dot com> 2012-12-21 03:32:21 UTC ---
However, there is room to improve both performance and stack consumption in
case of Os:
extern void bar(int *);
void foo()
{
int a;
bar(&a);
}
Built with -mcpu=cortex-m3 -Os:
push {r0, r1, r2, lr}
add r0, sp, #4
bl bar
pop {r1, r2, r3, pc}
Apparently it should be optimized to save 8 bytes of stack consumption and two
stores:
push {r0, lr}
mov r0, sp
bl bar
pop {r1, pc}