------- Comment #5 from jason at gcc dot gnu dot org 2008-06-25 21:49 -------
Here's another example:
struct A { int i[100]; };
void f(struct A);
int main()
{
f((struct A){1});
}
Here we build up the compound literal on the stack and then copy it into the
argument slot.
This seems to be a problem with GIMPLE, as there's no way to represent that we
want a particular temporary object to live in the argument slot.
This is both more and less of a problem for C++, as it has many more temporary
struct objects, but also has pass-by-reference (and the ABI does transparent
pass-by-reference for non-POD structs).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28831