https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43640
Seth LaForge changed:
What|Removed |Added
CC||sethml at ofb dot net
--- Comment #3 from Seth LaForge ---
For what it's worth, this generates similarly terrible code on ARM with gcc
5.2.1. It also occurs if the struct members are ints:
struct u1 { int x, y; };
int foo(struct u1 u) { return u.x + u.y; }
% arm-none-eabi-gcc -O3 -S foo.c
foo:
sub sp, sp, #8
add r3, sp, #8
stmdb r3, {r0, r1}
ldmia sp, {r0, r3}
add r0, r0, r3
add sp, sp, #8
bx lr
% arm-none-eabi-gcc --version
arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 5.2.1 20151202
(release) [ARM/embedded-5-branch revision 231848]