This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/55026] Useless stores generated for structures passed by value
- From: "mans at mansr dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 22 Oct 2012 19:34:25 +0000
- Subject: [Bug target/55026] Useless stores generated for structures passed by value
- Auto-submitted: auto-generated
- References: <bug-55026-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55026
--- Comment #3 from Mans Rullgard <mans at mansr dot com> 2012-10-22 19:34:25 UTC ---
It has actually got worse over time. With 4.3 I get this:
f:
sub sp, sp, #8
mov r2, r0
stmia sp, {r0, r1}
add r0, r1, r2
add sp, sp, #8
bx lr
Here it's only doing the stores, not the loads, and it does them using sp
directly.
With 4.4 and 4.5 it gets slightly worse:
f:
sub sp, sp, #8
mov r3, sp
stmia r3, {r0, r1}
mov r3, r0
add r0, r1, r3
add sp, sp, #8
bx lr
Now it's copying sp to another register used as base address in the store. The
load is still absent.
4.6 and later produce the code I quoted originally. I can't say I like the
trend.