http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51528
Richard Guenther <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|jamborm at gcc dot gnu.org |rguenth at gcc dot gnu.org --- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-01-27 13:05:40 UTC --- SRA creates, for struct S { int i; int j; }; struct S bar (struct S); struct S foo1 (int i) { struct S x; x.i = i; x = bar (x); /* LHS disqualified, RHS partially scalarized. */ return x; } for the aggregate copy to the return slot x$i_8 = x.i; D.1720 = x; D.1720.i = x$i_8; but that's needlessly complicated as it should just have created x.i = x$i_8; D.1720 = x; or for the similar case struct S g; struct S foo3 (int i) { struct S x; /* RHS disqualified, LHS partially scalarized. */ x = g; x.i = i; x = bar (x); return x; } it creates x = g; x$i_4 = g.i; x$i_8 = i_1(D); x.i = x$i_8; which is just a complicated from of x = g; x$i_4 = x.i; a sub-case which it handles fine when handling calls! x = bar (x); x$i_10 = x.i; That copy-in-out game to the unscalarized parts causes this regression.