Hi!
struct A { int a : 1, b : 1, c : 1, d : 1, e : 1, f : 1, g : 1, h : 1,
i : 1, j : 1, k : 1, l : 1, m : 1, n : 1, o : 1, p : 1,
q : 2, r : 2, s : 2, t : 2, u : 2, v : 2, w : 2, x : 2; };
struct A foo (struct A x)
{
return x;
}
struct A a, b;
struct A bar (void)
{
return a;
}
void baz (void)
{
a = b;
}
void test (struct A x)
{
a = x;
}
On say x86-64, foo is 529 bytes long (without padding) on HEAD at -O2,
while only 3 bytes long (2 insns) in 3.4.1. Similarly the test function.
bar and baz are the same size/speed as in 3.4.1.
The problem is that assignment of the struct argument is in SRA split up
into a series of field assignments, which is definitely way worse in this
case.