This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/23372] [4.0/4.1 Regression] Temporary aggregate copy not elided when passing parameters by value
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Aug 2005 14:30:40 -0000
- Subject: [Bug c++/23372] [4.0/4.1 Regression] Temporary aggregate copy not elided when passing parameters by value
- References: <20050813080257.23372.guillaume.melquiond@ens-lyon.fr>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From rguenth at gcc dot gnu dot org 2005-08-26 14:30 -------
For your last testcase,
struct A { int a[1000]; }
A f();
void g(A);
void h() { g(f()); }
all of 3.4 and 4.1 produce exactly two temporaries.
One to dump the result of f(), which get's copied to a new temp passed to g().
4.0 though produces one extra unnecessary copy.
The same holds true for C testcases.
--
What |Removed |Added
----------------------------------------------------------------------------
GCC host triplet|i486-linux-gnu |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23372